WASHINGTON (AP) — President Donald Trump’s former lawyer, Michael Cohen, admitted Thursday he lied to Congress about a Moscow real estate deal he had pursued on Trump’s behalf during the heat of the 2016 Republican campaign. He said he did so to be consistent with Trump’s “political messaging.”

Cohen’s guilty plea makes clear that prosecutors believe that Trump, who insisted repeatedly throughout the campaign that he had no business dealings in Russia, was continuing to pursue the project weeks after he had clinched the Republican nomination for president and well after he and his associates have publicly acknowledged.

The negotiations about building a Russian Trump Tower continued as late as June 2016 — the same month Trump’s oldest son met in Manhattan with a Kremlin-connected lawyer — even though Cohen told two congressional committees last year that the talks ended that January.

Cohen also discussed the proposal with Trump on multiple occasions and with unidentified members of the president’s family, according to court papers filed by special counsel Robert Mueller, who is investigating Russian interference in the presidential election and possible coordination with the Trump campaign. Cohen is cooperating with Mueller and has met with his team seven times, prosecutors say.

The Cohen case was filed in New York a week after Trump and his lawyers provided Mueller with responses to written questions and is the first new charge filed by the special counsel since the appointment of Matthew Whitaker, who has spoken pejoratively about the investigation, as acting attorney general with oversight of the probe. Whitaker was advised of the plea ahead of time, according to a person familiar with the investigation.

Cohen’s surprise court appearance marks the latest step in his evolution from trusted Trump consigliere — he said Thursday he had lied out of “loyalty” — to prime antagonist. It is the second time the lawyer’s legal woes have entangled Trump, coming months after Cohen said the president directed him during his campaign to make hush money payments to two women who said they had sex with Trump.

Trump on Thursday called Cohen a “weak person” who was lying to get a lighter sentence and repeatedly stressed that the real estate deal at issue was never a secret and never executed. His lawyer, Rudy Giuliani, said that Cohen was a “proven liar” and that Trump’s business organization had voluntarily given Mueller the same documents cited in the guilty plea “because there was nothing to hide.”

“We had a position to possibly do a deal to build a building of some kind in Moscow. I decided not to do it,” Trump said.

He said the primary reason he didn’t pursue it was “I was focused on running for president.” He added: “There would be nothing wrong if I did do it. I was running my business while I was campaigning.”

But during the campaign, Trump was repeatedly dismissive of claims that he had connections to the Kremlin, an issue that flared as especially sensitive in the summer of 2016 after a cybersecurity company asserted that Moscow was behind a cyberattack on the Democratic National Committee.

“I have a great company. I built an unbelievable company, but if you look there you’ll see there’s nothing in Russia,” Trump said at a July 2016 news conference.

“But zero, I mean I will tell you right now, zero, I have nothing to do with Russia,” he said at another point.

It was not immediately clear whether questions about the Russian Trump Tower real estate deal were among those answered by Trump and his lawyers last week. But a prior list of queries that Mueller’s team presented to Trump lawyers this year did include a question about it, and Mueller’s team is known to have asked about Trump’s business dealings over the years.

If he did answer questions on the topic, Trump could have problems the responses deviate from prosecutors’ factual narrative.

The nine-page charging document for Cohen traces the behind-the-scenes communication about the project that almost became reality in October 2015 when an obscure Russian real estate developer signed a letter of intent sent by Cohen for a 15-floor hotel, condominium and retail complex in Moscow.

Cohen’s comments made clear that his communications with Trump about the project were more frequent than he had suggested.

Cohen admitted lying about the timing of the negotiations, his communications with people in Trump’s company and in Russia about the deal, and other details to be loyal to Trump and consistent with Trump’s “political messaging.” Cohen and prosecutors referred to Trump as “Individual One” throughout Thursday’s proceedings and said Cohen lied “to be loyal to Individual One.”

Cohen said he also lied about his contacts with Russian officials and lied when he said he never agreed to travel to Russia in connection with the project and never discussed with Trump plans to travel to Moscow to support the project.

Prosecutors said Cohen had misled Congress to give a false impression that the Moscow project had ended before the Iowa presidential caucuses and first Republican presidential primary in 2016.

Nothing said in court, or in associated court filings, addressed whether Trump or his aides had directed Cohen to mislead Congress.

Thursday’s charges were handled by Mueller’s team, not the federal prosecutors in New York who handled Cohen’s previous guilty plea in August to other federal charges involving his taxi businesses, bank fraud and his campaign work for Trump. Cohen is to be sentenced Dec. 12, and guidelines call for little to no prison on the new charge.

Reacting to the plea, House Speaker Paul Ryan said Cohen “should be prosecuted to the extent of the law. That’s why we put people under oath.”

Cohen gave a statement to congressional committees last year saying the president’s company pursued a project in Moscow but that the plan was abandoned “for a variety of business reasons.”

Cohen also said he sent an email to the spokesman for Russian President Vladimir Putin concerning the potential deal.

In his statement, he said that he worked on the real estate proposal with Felix Sater, a Russia-born associate who he said claimed to have deep connections in Moscow.

The discussions about the potential development began after Trump had declared his candidacy. Cohen had said the talks ended when he determined that the project was not feasible.

Cohen had also disclosed that Trump was personally aware of the deal, signing a letter of intent and discussing it with Cohen on two other occasions.

___

Neumeister reported from New York. Associated Press writers Jim Mustian in New York and Stephen Braun in Washington contributed to this report.