First lady Melania Trump said Stanford Law Professor Pamela Karlan, who testified at Wednesday’s impeachment hearing, "should be ashamed” for invoking her 13-year-old son’s name as the butt of a joke during testimony.

Karlan used Barron Trump’s name to illustrate her point that President Trump can’t rule like a king.

"The Constitution says there can be no titles of nobility, so while the president can name his son Barron, he can’t make him a baron," Karlan said in the committee room, prompting chuckles across the room.

“A minor child deserves privacy and should be kept out of politics,” the first lady tweeted. "Pamela Karlan, you should be ashamed of your very angry and obviously biased public pandering, and using a child to do it."

White House Press Secretary Stephanie Grisham also expressed distaste for the quip.

LEGAL SCHOLARS CLASH IN HEARING OVER WHETHER TRUMP COMMITTED IMPEACHABLE OFFENSE

“Classless move by a Democratic ‘witness’. Prof Karlan uses a teenage boy who has nothing to do with this joke of a hearing (and deserves privacy) as a punchline,” Grisham tweeted. “And what’s worse, it’s met by laughter in the hearing room. What is being done to this country is no laughing matter.”

Karlan, hours later, apologized for the remark, but not without making another dig at the president.

“I want to apologize for what I said earlier about the president’s son. It was wrong of me to do that," Karlan said during the hearing. "I wish the president would apologize for the things that he’s done that’s wrong, but I do regret having said that."

Karlan was one of three legal scholars asked to testify by the Democrats in the first Judiciary Committee impeachment-inquiry hearing. The sole GOP witness was Jonathan Turley, a professor at George Washington University Law School.

Karlan’s Barron punchline came amid questions from Rep. Shelia Jackson Lee, D-Texas, about Trump’s conduct. “Contrary to what President Trump has said, Article Two does not give him the power to do anything he wants,” Karlan said, referencing the U.S. Constitution.

MATT GAETZ GRILLS IMPEACHMENT WITNESSES OVER DEMOCRATIC DONATIONS, SLAMS PROFESSOR'S DIG AT BARRON TRUMP

Rep. Matt Gaetz, R-Fla., confront Karlan later in the hearing for what he called her “little joke” about Barron.

"It does not lend credibility to your argument. It makes you look mean,” Gaetz said.

CLICK HERE TO GET THE FOX NEWS APP

Melania Trump and President Trump have been in the U.K., meeting with the royal family and Prime Minister Boris Johnson, along with attending a NATO anniversary reception. Barron is Melania’s only child.

Fox News' Marisa Schultz contributed to this report.