Former Obama White House counsel Greg Craig took the stand Wednesday in the foreign lobbying case against him, insisting in federal court that he did not lie to the United States government about his work in association with the government of Ukraine.

The case involves whether Craig’s legal work amounted to undeclared foreign lobbying. Craig, who did not register as a foreign agent, was questioned over his contacts with journalists after his firm was commissioned by the government of Ukraine to review the prosecution of Yulia Tymoshenko, a former Ukrainian prime minister.

In court, Craig acknowledged speaking with two reporters from The New York Times and a reporter from the London Telegraph about the report, but said he didn’t think he needed to register under the Foreign Agents Registration Act (FARA).

GREG CRAIG TO TESTIFY IN OWN DEFENSE AS TRIAL WINDS DOWN

“I did not think that any of those press contacts made me a press agent or agent for Ukraine,” Craig said.

But questioned on why he indicated to the Justice Department's FARA unit that he did not reach out to journalist David Sanger of the New York Times, Craig said: “I just muddled it up.”

Defendants in white-collar cases are often reluctant to testify and subject themselves to cross-examination. But 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.

In April, Craig became the first prominent Democrat to be indicted in a case arising from former special counsel Robert Mueller's now-completed probe into Russian election interference. Mueller referred the Craig case to prosecutors in New York last year after uncovering possible wrongdoing while he investigated former Trump campaign chairman Paul Manafort's Ukraine lobbying work.

The grand jury indicted Craig on two counts of making false and misleading statements to investigators -- including Mueller's team and the DOJ National Security Division's FARA Unit -- in connection with his work on behalf of Russia-backed former President of Ukraine Viktor Yanukovych. One of those counts was dismissed before trial.

JUDGE DISMISSES ONE COUNT AGAINST CRAIG DAYS BEFORE TRIAL

FARA-related cases rarely go to trial. But the work that drew the Justice Department's attention occurred in 2012, when Craig and his law firm at the time — Skadden, Arps, Slate, Meagher & Flom — were engaged by the government of Ukraine to review the prosecution of Tymoshenko and produce a report on whether the trial met Western standards of justice.

Tymoshenko was a political opponent of Yanukovych, a longtime Manafort patron and a political figure whom partner Rick Gates said they had helped get elected.

In court on Wednesday, Craig said the report never came to a conclusion about whether Tymoshenko's prosecution had been politically motivated.

"It was important to me that the media accurately describe the report that we had written,” he said. “Otherwise it would look like we had written whatever Ukraine wanted us to write, and that just wasn't true.”

The criminal prosecution marks a dramatic fall for the now-retired attorney who previously served as White House counsel in the Obama administration and has represented a roster of high-profile clients.

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.

Fox News’ Gregg Re and The Associated Press contributed to this report.