MONTGOMERY, Ala. — A once-prominent Alabama lawmaker pleaded guilty to a mail fraud charge for using campaign funds for personal expenses, federal prosecutors announced on Tuesday.

Rep. Micky Hammon, a Decatur Republican and former majority leader, pleaded guilty Monday to a felony mail fraud charge. U.S. Attorney Louis Franklin said Hammon would withdraw money from campaign committee’s bank account by writing a check to himself. He would then use the campaign money for personal expenses. Authorities said it came to more than $500 but they have not yet calculated how much he took, nor could they say how he spent it.

A spokesman for the state House of Representatives said Hammon has automatically been removed from his legislative office because the charge is a felony.

“Those who donated to Representative Hammon’s campaign expected that the campaign would use those resources lawfully and to foster an informative public debate. Instead, Representative Hammon placed those funds into his own personal piggy bank,” Franklin said in a statement.

An attorney for Hammon did not immediately return an email requesting comment.

Hammon has served in the Alabama Legislature since 2003. Until this year he was a member of the GOP leadership, serving as majority leader for Republicans in the House of Representatives.

Hammon, 60, this year stepped down as majority leader, after narrowly surviving a vote of confidence from fellow Republican lawmakers, and announced that he would not seek re-election in 2018.

The Republican lawmaker is perhaps best known as the author of a stringent 2011 immigration law. Much of the law was later overturned by the federal courts.

The fraud charge is punishable by up to 20 years in prison.