Former Alabama state Rep. Greg Wren, R-Montgomery, left, arrives at Montgomery County District Court Tuesday, April 1, 2014, in Montgomery, Ala. Wren resigned from the Legislature on Tuesday before pleading guilty to a misdemeanor ethics violation. (AP Photo/AL.com, Julie Bennett)

MONTGOMERY, Ala. (AP) – Rep. Greg Wren, one of Alabama’s veteran Republican legislators, pleaded guilty Tuesday to a misdemeanor ethics violation and agreed to assist prosecutors with an ongoing investigation of state government.

Wren, 59, of Montgomery, resigned from the Alabama Legislature effective immediately as a condition of the plea deal, according to a copy of the agreement.

Wren admitted to taking action in the Alabama Legislature that could have steered Medicaid pharmacy business to a Bessemer pharmacy cooperative that had ties to another company that hired Wren as an $8,000-a-month consultant, according to the plea agreement.

“Public servants who violate their oath of office in order to achieve personal gain should expect to be held accountable,” acting Attorney General Van Davis said in a statement.

Davis was appointed as acting attorney general in the case after Attorney General Luther Strange recused himself. Davis said the guilty plea marked “a significant point in the ongoing investigation.”

Wren’s attorney, James Anderson, said Wren did not know about the relationship between the two companies. He said it was a misdemeanor because it was an unintentional violation of state ethics law.

Speaking outside the courtroom, Wren said, “I’m kind of glad to have this behind me. It’s been a difficult process. I look forward to the future and just a change in scenery.”

Wren, a four-term veteran of the Legislature, was first elected to the Alabama Legislature in 1994. He announced earlier this year that he would not seek re-election in November.

Anderson said Wren has testified once before a special grand jury empaneled by the state attorney general’s office in Lee County.

According to the plea agreement, Wren was paid by a company called RxAlly, a national company that was owned in part by a pharmacy cooperative located in Bessemer, according to the agreement. The president of the cooperative also served on the board of directors for RxAlly.

Wren, according to the plea deal, helped put language in the state General Fund budget last year that set requirements for any pharmacy benefit manager that might eventually be hired by the Alabama Medicaid Agency.

The Bessemer-based pharmacy cooperative was the only company that met the requirements, according to the plea deal

The language was later stripped by the Alabama Senate.

Wren also provided confidential state Medicaid documents to RxAlly in May.

District Judge Jimmy Pool gave Wren a 12-month suspended sentence and ordered him to pay $24,000, the amount he was paid by RxAlly, in restitution to the state.

The Bessemer pharmacy cooperative also had ties to House Speaker Mike Hubbard, R-Auburn, according to the plea agreement.

Hubbard and staff members attended a meeting about pharmacy language, according to the plea agreement.

“After meeting with Wren and others, and reviewing the co-op exclusive language, the speaker of the house endorsed the co-op exclusive language and directed staff to add it to Medicaid’s section of the General Fund budget,” the plea agreement said.

The plea agreement also said Wren did not know until later that Hubbard had a financial relationship with the cooperative.

Hubbard told al.com this summer that his company, the Auburn Network, did business development work for the Bessemer-based American Pharmacy Cooperative Inc. Hubbard said he only worked on out-of-state matters for the group.

Hubbard also told al.com that he had nothing to do with putting that language in the budget.

A lawyer for Hubbard said that he would not discuss Wren’s plea agreement, but said Hubbard’s work for the pharmacy cooperative had been public for some time.

“The matters related to Rep. Wren’s actions today do not involve or affect Speaker Hubbard. Mr. Wren’s actions will not stop or affect the work that is left to be done during this legislative session,” Mark White said in a statement.

White said Hubbard’s company no longer does work for the pharmacy cooperative.

(Copyright 2014 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.)