CNN  — 

When Iowa state Sen. Matt McCoy learned Donald Trump had appointed Matthew Whitaker to be acting attorney general of the United States, he was aghast – he believes Whitaker was behind a politically motivated prosecution that was personally “devastating” to him.

It started in 2007, when McCoy was a rising Democrat in state politics, and the state’s first openly gay lawmaker. Whitaker was the US attorney for Iowa’s Southern District at the time.

A grand jury indictment accused McCoy of using his elected office to try to extort $2,000 from a Des Moines home security company where McCoy was a consultant. The charges came after an elaborate undercover investigation in which the FBI had McCoy’s business partner wear a recording device. McCoy demanded money he says he was owed for his consulting work.

In an interview with CNN this week, McCoy said Whitaker “certainly tried to prove that I had done something really awful when, in fact, it was a garden variety business dispute that should have been handled in small claims court, if anywhere.”

The trial lasted more than a week, with prosecutors trying to prove the business partner never agreed to pay McCoy for his consulting and the defense torpedoing the partner’s testimony because he couldn’t recall many details and admitted he had trouble with sobriety, according to Des Moines Register articles on the trial.

In the end, the jury reached a not guilty verdict in an hour and a half, including time for lunch, according to the Des Moines Register.

“I believe it was a political prosecution, there’s no doubt in mind, I’m 100% certain that it was,” McCoy said, adding he believes he was targeted not just because he’s a Democrat, but also because he’s gay. “As US attorney (Whitaker) spoke at Christian Coalition events and would often refer to bringing God into his decision-making process and being guided by God’s hand,” McCoy said, “and so I believe that he was very much resentful of my lifestyle and I believe that played a factor in it.”

Whitaker has been facing questions from reporters about whether the case was politically motivated since the day the indictment was announced in 2007. An editorial in the Des Moines Register soon after McCoy was acquitted called for the government to compensate McCoy for his legal fees and questioned, “Was the McCoy prosecution a product of poor judgment, inexperience, misplaced zeal or partisan politicking? Perhaps all of the above.”

A Justice Department official sent a statement to CNN defending the case. “As a U.S. Attorney, then-US Attorney Whitaker had a responsibility to uphold the rule of law and pursue credible allegations of illegal activity. The Department of Justice signed off on bringing the case, the FBI conducted an independent investigation, and career prosecutors handled the case throughout its duration. The jury’s verdict does not negate the obligation of law enforcement agencies to open cases when they determine laws may have been broken.”

McCoy said the two-year legal battle exhausted his finances and left a lasting impact on his life. “I was putting my whole family in an emotional state as a result of that. I had elderly parents, I had a young son … It took an emotional toll on the people that I loved and it was completely unnecessary.”

McCoy continued as a state senator for 11 more years, a position he will hold until January. He was just elected to the Polk County Board of Supervisors, winning with 82% of the vote.

Whitaker left his position as US attorney in 2009 and ran unsuccessfully for the US Senate in 2014. He also unsuccessfully vied for a seat on the Iowa Supreme Court, then went on to create the Foundation for Accountability and Civic Trust, a Washington nonprofit funded almost entirely by dark money. In 2017, he became former Attorney General Jeff Sessions’ chief of staff until this week, when he stepped into his former boss’ job.

CNN’s Scott Bronstein and Madeleine Ayer contributed to this report.