(Reuters) - Florida’s Republican governor on Friday signed a bill to restore the voting rights for felons who have served their time but he wants them to pay all fines and restitution before casting a ballot, a hurdle that immediately drew a lawsuit from civil rights groups.

Governor Ron DeSantis opposed a ballot measure that Florida voters overwhelmingly approved in November allowing felons to vote after they complete their sentence, with exceptions for those convicted of murder and sexual offenses.

The newly enacted law would limit voting rights to convicted felons who have wealth, disenfranchising many others who cannot pay their fees, civil rights groups said.

“This law will disproportionately impact black Floridians with a felony conviction, who face the intersecting barriers of accessing jobs in a state with long-standing wealth and employment disparities,” Leah Aden, deputy director of litigation at the NAACP Legal Defense and Educational Fund, said in a statement.

The Florida ballot measure launched one of the largest enfranchisement efforts in modern U.S. history, with more than 1 million people potentially eligible to regain their right to vote in a state with a population of 21 million.

DeSantis, in a signing statement, said the law “confirms that the amendment does not apply to a felon who has failed to complete all the terms of his sentence.”

The text of the newly enacted law states that felons seeking to regain their right to vote must pay fines or restitution to victims as ordered by a court.

A federal lawsuit filed on Friday by the American Civil Liberties Union and other groups accused officials of denying the rights of Florida felons under the U.S. Constitution by imposing the requirement for fines and restitution.

A representative for DeSantis did not return a call or email seeking comment on the lawsuit.

DeSantis had said in December the Republican-controlled legislature would need to pass a law to implement the ballot measure approved by voters, drawing the ire of Democrats who accused him of trying to subvert the will of the people.

Florida began barring ex-felons from voting about 150 years ago, after slaves were freed during the Civil War. African-Americans, who favor the Democratic Party, have been disproportionately affected by felon voter disenfranchisement.

Several other states continue to bar people convicted of certain crimes from voting after they serve their sentence. But more than a dozen allow felons to cast a ballot after they leave jail or prison, while in Maine and Vermont felons can vote from behind bars.