Former US Secretary of State John Kerry mocked President Donald Trump, saying he has the “immaturity of an 8-year-old boy and the insecurity of a teenage girl.”

Kerry made the remarks in an interview with HBO on Friday while discussing Trump's frequent use of social media and touting former Trump campaign chairman Paul Manafort's plea deal with the special counsel's office.

On Friday, Manafort agreed to plead guilty to two criminal counts in Special Counsel Robert Mueller’s investigation, Presstv Reported.

According to court documents, Manafort pleaded guilty to one count of conspiracy against the country and one count of conspiracy to obstruct justice.

Kerry first praised Manafort's plea deal and then launched into a personal attack on Trump.

"I don’t want to get into a real riff on this but I’ve got to tell you," Kerry began.

“He really is the rare combination of an 8-year-old boy — he’s got the immaturity of an 8-year-old boy with the insecurity of a teenage girl,” he said.

Kerry also responded to Trump's Twitter attack against him from the previous night when the president accused him of illegally meeting with foreign dignitaries after leaving the State Department.

“John Kerry had illegal meetings with the very hostile Iranian Regime, which can only serve to undercut our great work to the detriment of the American people. He told them to wait out the Trump Administration! Was he registered under the Foreign Agents Registration Act? BAD!” Trump tweeted on Thursday.

John Kerry had illegal meetings with the very hostile Iranian Regime, which can only serve to undercut our great work to the detriment of the American people. He told them to wait out the Trump Administration! Was he registered under the Foreign Agents Registration Act? BAD!

When asked what he had done that was so “bad” in Trump's view, Kerry said: “I think I told the truth.”

In May, United States President Donald Trump pulled the US out of the Iran Nuclear deal, known as the Joint Comprehensive Plan of Action (JCPOA), claiming it to be a bad deal.

Kerry, who played a main role in the deal and has described it as the “single strongest, single most accountable, single most transparent nuclear agreement anywhere in the world.” He has criticized the Trump administration for pulling out of the Iran nuclear deal.

On Friday, Kerry said that there is “absolutely nothing unusual” about former diplomats continuing to meet with officials from other countries.

The 2004 Democratic presidential nominee and former Massachusetts senator said Trump should not worry about his conversations with Iranians, he should be more worried about Manafort's plea deal with Mueller, which includes fully cooperating with the probe into Russian meddling in the 2016 election.

“It really is giant, and soon you’ll be hearing him say that is the worst that’s ever been made. When you think about it, it’s really gone from the 'Art of the Deal' to the art of the squeal,” Kerry said.

Earlier on Friday, US Secretary of State Mike Pompeo criticized Kerry for holding talks with Iranian diplomats.