Former U.S. secretary of state John F. Kerry is being criticized for comparing President Trump to a teenage girl during an appearance on HBO’s “Real Time with Bill Maher.”

Kerry visited the late-night talk show Friday to promote his new memoir, “Every Day is Extra.” Shortly after Kerry sat down, however, host Bill Maher brought up a Trump tweet from the day before, in which the president had accused the former secretary of state of having “illegal meetings” with the Iranian government.

“BAD!” Trump wrote at the end of the tweet.

“What did you do, John F. Kerry, that was 'BAD’?” Maher asked Kerry.

“I think I told the truth,” Kerry replied. “He’s the first president that I know of who spends more time reading his Twitter ‘likes’ than his briefing books or the Constitution of the United States."

Former U.S. secretary of state John F. Kerry speaks during a Bloomberg Television interview at the Global Climate Action Summit in San Francisco on Sept. 14, 2018. (David Paul Morris/Bloomberg News)

The crowd cheered. Kerry continued to lament what he thought was the deleterious effect of Trump’s lies on American democracy.

“Unfortunately, we have a president, literally, for whom ‘the truth, the whole truth and nothing but the truth’ is three different things. And you don’t even know what they are,” Kerry said. “I don’t want to get into a real riff on this, but I gotta tell you —”

“Do it!” someone in the audience shouted, egging him on.

Kerry acknowledged the interjection, then continued: “He really is the rare combination of an 8-year-old boy — I mean, he’s got the maturity of an 8-year-old boy with the insecurity of a teenage girl. It’s just who he is.”

“A ‘mean girl!’” Maher said.

“Mean girls,” Kerry replied, nodding. “It can be mean.”

Kerry shrugged. Maher laughed. The audience applauded. The two men moved on to discuss a variety of other subjects covered in the forthcoming memoir, including Kerry’s work as secretary of state and his friendship with the late senator John McCain.

Online, though, Kerry’s comments were not as well received. Though some lauded the comparison as “absolutely priceless” and a “mic drop” moment, many expressed disappointment in Kerry, even if they agreed with his assessment of Trump.

Others cited young women like Malala Yousafzai, the youngest Nobel Prize laureate, and Parkland shooting survivor-turned-anti-gun-violence activist Emma González — or even their own past teenage selves — as examples of teenage girls who were far from insecure.

Kerry’s name has often come up in predictions about which Democrats might run for president in 2020. The longtime senator from Massachusetts narrowly lost the 2004 presidential election to Republican George W. Bush.

For his part, Kerry has said he doubts he will run for president again — but he has not explicitly ruled it out in numerous interviews.

“I’m really not thinking about it,” Kerry said in an interview with CBS News this month. “Talking about 2020 right now is a total distraction and waste of time. What we need to do is focus on 2018.”

Read more:

John F. Kerry doesn’t rule out a bid for president in 2020

The top 15 Democratic presidential candidates for 2020, ranked

Jim Carrey tells Democrats: ‘We have to say yes to socialism’

Analysis | Sorry, Mr. President: The Hurricane Maria death toll in Puerto Rico didn’t grow by ‘magic.’