Washington — After nearly 100 years of failed attempts, the Senate on Wednesday unanimously approved legislation to make lynching a federal crime.

Sponsored by the Senate’s three African-American members, Kamala Harris, D-Calif.; Cory Booker, D-N.J.; and Tim Scott, R-S.C.; the bill would ensure that lynching triggers an enhanced sentence under federal law like other hate crimes.

“This has been a long arc, a painful history and a shameful history in this body,” Booker, who has been mentioned as a possible 2020 presidential candidate, said on the Senate floor. “At the height of lynchings across this country affecting thousands of people, this body did not act to make that a federal crime. … At least now, the United States Senate has now acted. One hundred senators, no objections.”

Booker introduced the bill with Harris, another possible presidential hopeful, and Scott following what Harris described as 200 previous attempts by Congress to pass similar legislation.

“Lynching is a dark and despicable aspect of our nation’s history. We must acknowledge that fact, lest we repeat it,” Harris tweeted after the bill passed.

The NAACP says lynching emerged in the late 19th century as a “popular way of resolving some of the anger that whites had in relation to free blacks.” About 3,450 black people were lynched in the United States between 1882 and 1968, accounting for 73 percent of the total number of people lynched.

Only five states had no lynchings during that period, according to the NAACP.

The Senate bill defines someone guilty of lynching as “willfully, acting as part of any collection of people, assembled for the purpose and with the intention of … (causing) death to any person.” The crime could be punished by a sentence of up to life in prison.