Matt McCoy, Iowa's first openly gay state senator, has claimed that Matthew Whitaker pursued federal charges against him in 2007 because of his sexual orientation, and warned that Whitaker, who President Donald Trump on Wednesday named as acting attorney general after he fired Jeff Sessions, will abuse his position.

According to the AP, Whitaker pursued McCoy while serving as the U.S. attorney for the Southern District of Iowas based in Des Moines.

Whitaker charged McCoy with attempted extortion by an elected official. McCoy faced 20 years in prison, if convicted. Prosecutors alleged that McCoy demanded $2,000 from Thomas Vasquez for a waiver to Iowa's Medicaid program to sell home security products for the elderly.

Vasquez recorded 12 hours of conversations with McCoy and made the payments with money supplied by the FBI.

McCoy, who also operated a consulting business, met Vasquez through Alcoholics Anonymous. Vasquez and McCoy signed a contract that paid McCoy $100 for each security system he sold through his firm. The relationship soured, and McCoy said that he accepted the payments because he believed that Vasquez was following through on money he was owed.

Whitaker's office acknowledged that it had made a mistake in withholding information that showed that Vasquez was a paid FBI informant. Critics also pointed out that the prosecution withheld evidence from the grand jury that would have cleared McCoy, such as playing parts of the recordings where McCoy directed Vasquez to write checks to his company.

Vasquez had a history of domestic and substance abuse problems. He filed for bankruptcy in 2001. At a pretrial hearing, he said that it was likely he used some of the money the FBI paid him to buy drugs.

After a 9-day trial, jurors quickly – two hours with a long lunch break – and unanimously returned a not guilty decision. The incident damaged McCoy's reputation and left him with $100,000 in legal fees. He said that he believes Whitaker pursued him in part because of his sexuality.

(Related: Acting AG Matt Whitaker defended man's “religious beliefs” to call LGBT “the enemy.”)

“I'm still carrying this around my neck – both the financial burdens as well as the emotional scars,” McCoy told the AP. “This all happened so that Whitaker could have a political trophy on the wall and I was it.”

Des Moines Register columnist Rekha Basu was among those who criticized Whitaker's office.

“Why would the federal government contact, wire and pay an informant without checking him out – or, worse, despite knowing he was disreputable?” Basu wrote. “It has all the earmarks of a politically motivated witch hunt.”

Speaking with NPR, McCoy added: “And so I know Matt Whitaker will misuse his office, because I've seen it. And I know that he will misuse his power, because he's done it.”