WASHINGTON — A prominent Washington lawyer testified Wednesday that he never misled the Justice Department about his work for the government of Ukraine, as he sought to challenge allegations that his legal work crossed a line into foreign lobbying.

Greg Craig took the stand in his own defense in a case that emerged as an offshoot of special counsel Robert Mueller's Russia investigation and that has placed a spotlight on the lucrative world of foreign lobbying in Washington. The criminal prosecution marks a dramatic fall for the now-retired attorney who previously served as White House counsel in President Barack Obama's administration and has represented a roster of high-profile clients.

Though it's unusual for defendants to testify on their own behalf, and subject themselves to bruising cross-examination, Craig's testimony appeared vital to the defense effort to rebut allegations that he was part of a public relations campaign for the Ukrainian government and that he lied to the Justice Department about it.

The case centers on a report that was commissioned by Ukraine in 2012 and completed by Craig and his then-law firm, Skadden, Arps, Slate, Meagher & Flom, that reviewed the criminal prosecution of Ukraine's opposition leader, Yulia Tymoshenko.

Craig said his report found significant flaws with the way Tymoshenko's case was handled, even though the Ukrainian government wanted the trial to be viewed as fair and legitimate to counter widespread criticism of the proceedings that damaged its standing in the world.

Craig said he discussed the report's findings with American and British journalists because he was concerned that it would otherwise be spun in Ukraine's favor. He said because that position broke with the Ukrainian government's position, he did not believe that he needed to register with the Justice Department as a foreign agent.

"It was important to me that the reports in the newspapers, that the media, accurately described the work that we had done and the report that we had written," Craig said. "Otherwise, it would appear that we were just writing whatever Ukraine wanted us to write. That wasn't true. We were an independent group of lawyers who had conducted this investigation and evaluated the fairness of the trial."

The Justice Department enforces the Foreign Agents Registration Act, which was enacted in 1938 to unmask Nazi propaganda in the United States. It requires people to disclose to the Justice Department when they advocate, lobby or perform public relations work in the U.S. on behalf of a foreign government or political entity.