The U.S. State Department on Thursday said the U.S. takes offense at comments made by Israeli Prime Minister Benjamin Netanyahu’s new communications director accusing President Obama of anti-Semitism and saying Secretary of State John Kerry had the mental capacity of a 12-year-old.

“His comments about U.S. officials, including the president and Secretary Kerry, we believe were troubling and offensive. We obviously expect government officials from any country, especially our closest allies, to speak respectfully and truthfully about senior U.S. government officials,” State Department spokesman John Kirby said, Reuters reported.

On Wednesday, the day Ran Baratz, 42, was appointed to be Mr. Netanyahu’s new media chief, it was revealed he had posted such comments on Facebook and other Web pages.

In a March Facebook post, Mr. Baratz, a philosophy lecturer, described Mr. Obama’s criticism of Mr. Netanyahu’s opposition to the nuclear deal with Iran as “the modern face of anti-Semitism in Western and liberal countries.”

In October last year, Mr. Baratz took aim at Mr. Kerry in an article on Mida, which bills itself as a “news and intellectual website” dedicated to providing information and views not prevalent in other Israeli media.

In the article he blasted “comical” remarks Mr. Kerry made on the occasion of a Muslim holiday, when he said Middle East leaders told him negative feelings stirred by Israeli-Palestinian tensions contributed to Islamic State recruitment numbers.

“This is the time, then,” Mr. Baratz wrote, “to wish the secretary of state success and count down two years on the calendar with the hope that someone in the State Department will then wake up and begin to see the world through the eyes of a man with a mental age above 12.”

Mr. Netanyahu has described the comments as totally unacceptable and said he will “review” Mr. Baratz’s appointment, BBC news reported.

An Israeli official told Reuters that Mr. Baratz has apologized to Mr. Netanyahu in a phone conversation, and in a statement, Mr. Netanyahu distanced himself from the comments but indicated the appointment remained valid. He said the two would meet, at Mr. Baratz’s request, after he returns from his U.S. trip next week.

“I have just read the things that Dr. Ran Baratz published on the Web, including the comments about the Israeli president, the president of the United States and other public figures here and in the U.S. They are inappropriate and do not reflect my positions or the policies of the government,” Mr. Netanyahu said.

White House spokesman Josh Earnest welcomed Mr. Baratz’s apology and said his comments would not affect negotiations between Mr. Obama and Mr. Netanyahu.

“It’s readily apparent that apology was warranted. But obviously the decisions that Prime Minister Netanyahu has to make about who will serve his government and represent him and his country are decisions that he rightfully will make on his own,” Mr. Earnest told a news briefing.