WASHINGTON — President Trump’s former lawyer, Michael Cohen, confessed in a surprise guilty plea Thursday that he lied to Congress about a Moscow real estate deal he pursued on Trump’s behalf during the heat of the 2016 Republican campaign. He said he lied to be consistent with Trump’s ‘‘political messaging.’’

Cohen’s plea arrangement made clear that prosecutors believe that while Trump insisted repeatedly throughout the campaign that he had no business dealings in Russia, his lawyer was continuing to pursue the Trump Tower Moscow project weeks after his boss had clinched the Republican nomination for president and well after the point he and his associates have publicly acknowledged.

Advertisement

Cohen said he discussed the proposal with Trump on multiple occasions and with 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 acknowledged considering traveling to Moscow to discuss the project.

There is no clear link in the court filings between Cohen’s lies and Mueller’s central question of whether the Trump campaign colluded with Russia. And nothing said in court, or in associated court filings, addressed whether Trump or his aides had directed Cohen to mislead Congress.

Still, the case underscores how Trump’s business entity, the Trump Organization, was negotiating business in Moscow at the same time investigators believe that Russians were meddling on his behalf in the 2016 election, and that associates of the president were mining Russian connections during the race.

The Cohen revelation comes as Mueller’s investigation is showing fresh signs of aggressive activity. Earlier this week, Mueller’s team accused Trump’s former campaign chairman, Paul Manafort, of lying after his own guilty plea. The special counsel continues to investigate whether campaign associates had advance knowledge of hacked emails becoming public. Another potential target, Jerome Corsi, has rejected a plea offer and faces a possible indictment. Last week, Trump for the first time provided Mueller with responses to written questions.

Advertisement

Cohen is the first person charged by Mueller with lying to Congress, an indication the special counsel is prepared to treat that offense as seriously as lying to federal agents and a warning shot to dozens of others who have appeared before lawmakers.

Cohen told two congressional committees last year that the talks about the tower project ended in January 2016, a lie he said was an act of loyalty to Trump. In fact, the negotiations continued until June 2016, Cohen acknowledged.

His court appearance Friday marked the latest step in his evolution from trusted Trump consigliere to prime antagonist. Prosecutor say Cohen is cooperating with Mueller and has met with his team at least seven times. 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.’’

Advertisement

‘‘There would be nothing wrong if I did do it,’’ Trump said of pursuing the project. ‘‘I was running my business while I was campaigning. There was a good chance that I wouldn’t have won, in which case I would have gone back into the business, and why should I lose lots of opportunities?’’

He said the primary reason he didn’t pursue it was ‘‘I was focused on running for president.’’

About an hour later, Trump canceled a planned meeting with Russian President Vladimir Putin at the Group of 20 nations.

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 the Democratic National Committee and a cybersecurity company asserted that Moscow was behind a punishing cyberattack on the party’s network.

‘‘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.

Mueller team has asked Trump about the Russian real estate deal, but it was not immediately clear whether it was one of the questions Trump answered last week.

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

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

Advertisement

Whitaker was advised of the plea ahead of time, according to a person familiar with the investigation.

The nine-page charging document for Cohen traces the behind-the-scenes communication about the project that had first been discussed more than 20 years ago. It 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 then looped in Donald Trump Jr. and Ivanka Trump, copying them on emails about it in late 2015, according to a person close to the Trump Organization. In one email, Ivanka Trump even suggested an architect for the building, the person said, noting the Trump Organization provided the emails to congressional committees. The company’s email traffic about the project ends in January 2016, said the person, who wasn’t authorized to speak publicly about the matter and spoke on condition of anonymity.

On Jan. 14, 2016, just weeks before the Republican party caucus in Iowa, Cohen emailed the office of Kremlin spokesman Dmitry Peskov asking for help getting the Trump Tower Moscow project off the ground. He then had a 20-minute phone call with one of Peskov’s assistants about it and asked for help ‘‘in securing land to build the proposed tower and financing the construction,’’ court papers say.

Advertisement

The dialogue resumed over the next several months with the Republican primaries in full swing.

In early May, prosecutors say, Cohen and Felix Sater, an executive who had worked on and off for the Trump Organization, discussed having Trump visit Russia after the Republican National Convention. They also discussed the possibility of Cohen meeting in June with Putin and Russian Prime Minister Dmitry Medvedev.

On June 9, 2016, Trump Jr., Manafort, and Trump’s son-in-law, Jared Kushner, met with a Kremlin-connected lawyer at Trump Tower in New York about getting ‘‘dirt’’ on Democrat Hillary Clinton.

Around that time, prosecutors say, Cohen and Sater exchanged several messages about the Moscow project and Cohen’s travel to Russia, and the DNC announced that its computer networks were penetrated by Russian hackers.

Cohen and prosecutors referred to Trump as ‘‘Individual 1’’ throughout Thursday’s proceedings and said Cohen lied ‘‘to be loyal to Individual 1.’’

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.

Thursday’s charges were handled by Mueller, 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. Guidelines call for little to no prison time on the new charge.