Michael Cohen, President Trump’s former personal attorney who once famously claimed he would "take a bullet" for his boss, pleaded guilty Thursday to lying to Congress about a Trump real estate project in Russia in the latest development in Special Counsel Robert Mueller’s investigation.

The president swiftly fired back, blasting Cohen as a "weak person," and claiming his former attorney was "lying" to get a reduced sentence.

Cohen entered the plea in a surprise, 30-minute federal court appearance in New York City on Thursday. He pleaded guilty to making false statements to the Senate Intelligence Committee in 2017 about a plan to build a Trump Tower in Moscow. Cohen’s attorney, Lanny Davis, was not present in court on Thursday. Instead, he was represented by attorneys Guy Petrillo and Amy Lusker.

Thursday marked the first time Mueller’s team charged Cohen as part of its investigation into Russian meddling and potential collusion with Trump campaign associates during the 2016 presidential election.

“Cohen made the false statements to minimize links between the Moscow Project and Individual 1 [Trump] and give the false impression that the Moscow Project ended before ‘the Iowa caucus … the very first primary,’ in hopes of limiting the ongoing Russia investigations,” Mueller wrote Thursday.

“Cohen did recall that in or around January 2016, Cohen received a response from the office of Russian Official 1, the Press Secretary for the President of Russia, and spoke to a member of that office about the Moscow Project,” Mueller added.

The plea agreement makes clear that as part of the deal, Cohen is cooperating with Mueller's team on "any and all matters" deemed relevant.

Mueller’s team wrote that Cohen “will not be further prosecuted criminally by this Office for the conduct” or “for any other false statements” or “for aiding or abetting in the obstruction of, or conspiring to obstruct or commit perjury before congressional or grand jury investigations.”

The maximum sentence Cohen faces is five years in prison and a fine of up $250,000.

After entering his plea, Cohen addressed the court for several minutes.

"Prior to the 2016 elections, I was a counsel and advisor to Donald Trump Organization. By 2016, I no longer did that work, but I continued to work for Donald Trump who became President of the United States, referenced as Individual 1 in the agreement,” Cohen said in court Thursday. “I continued to follow the political messaging of Individual 1 and his advisors. I was aware that Individual 1 said he was not tied to Russia, attacks were politically motivated, and all interactions were terminated by the time of the Iowa Caucuses.”

Cohen added that in 2017 when he appeared before the Senate Intelligence Committee, he gave a “false” description of the Moscow Project.

“I asserted all efforts ceased in January 2016 when they kept going until June 2016,” he said. “There were more extensive communications. I said I never contemplated travel or spoke to Individual 1 regarding travel, but I did.”

He added: “I would like to add that I never did travel to Russia and I have never been to Moscow. I made the statement to keep up with political messaging and out of loyalty.”

Cohen added Thursday that he once spoke to someone in the Kremlin for approximately 20 minutes.

Meanwhile, as Trump departed the White House Thursday for the G-20 summit in Argentina, he blasted Cohen.

"He is a weak person and not a very smart person," Trump said. "It's very simple. He's got himself a big prison sentence and he's trying to get a much lesser prison sentence by making up a story. And here's the thing, even if he's right, I was allowed to do whatever I wanted during the campaign."

Trump said the "primary reason" he decided not to go forth with the Moscow Project was because of his presidential run.

"Everybody knew about it. It was written about in newspapers. It was a well-known project," Trump said. "If I did do it, there would have been nothing wrong."

Trump added that Cohen has been implicated in crimes "totally unrelated to the Trump Organization, having to do with mortgages, and having to do with cheating the IRS."

When asked why he would have someone not "smart" on his team for more than a decade, Trump said it was because of a favor.

The Wall Street Journal reported in September that Mueller had interviewed Cohen over the Trump Tower deal in Russia.

Cohen told the Senate Intelligence Committee last year that the possible project was “solely a real estate deal and nothing more” and it was scrapped before the Iowa caucus and months before the first primary.

“Michael Cohen … knowingly and willfully made a materially false, fictitious, and fraudulent statement and representation to wit, Cohen caused to be submitted a written statement to SSCI containing material false statements about the Moscow Project, including false statements about the timing of the Moscow Project, discussions with people in the Company and in Russia about the Moscow Project, and contemplated travel to Russia in connection with the Moscow Project,” Mueller’s team wrote Thursday.

In August, Cohen pleaded guilty in a separate case to violating federal campaign finance laws by arranging hush-money payments to porn star Stormy Daniels and Playboy model Karen McDougal in the weeks leading up to the election “at the direction” of then-candidate Trump.

Cohen has been under criminal investigation as part of a grand jury probe into his personal business dealings, including his taxi business and bank fraud, since April, when the FBI raided his home, office, and hotel room to seize a collection of documents as part of the U.S. Attorney’s Office for the Southern District of New York’s criminal probe.

In August, Cohen pleaded guilty to five counts of tax evasion, one count of making false statements to a financial institution, one count of willfully causing an unlawful corporate contribution, and one count of making an excessive campaign contribution. The excessive campaign contribution was regarding the $130,000 payment made to Daniels, whose real name is Stephanie Clifford, in the weeks leading up to the 2016 presidential election in exchange for her silence about an alleged one-time sexual encounter with Trump.

Trump denied in April that he knew anything about Cohen’s payments to Daniels, though the explanations from the president and his attorney Rudy Giuliani have shifted several times.

Cohen could have received up to 65 years in prison if convicted of all charges. However, as part of his plea deal, Cohen agreed not to challenge any sentence between 46 and 63 months. The deal made in August did not involve a cooperation agreement with federal prosecutors. Cohen, as part of that criminal investigation, is slated to be sentenced in New York City federal court on Dec. 12.

Last year, Cohen testified and provided statements to both the House and Senate Intelligence Committee as part of congressional probes into Russian meddling and potential collusion with Trump campaign associates during the 2016 presidential election.

Fox News' Rick Leventhal, Tamara Gitt, and The Associated Press contributed to this report.