Israeli Prime Minister Benjamin Netanyahu's newly appointed spokesman on Thursday apologized for a series of insulting comments about President Barack Obama and Secretary of State John Kerry, days before his boss heads to Washington on a fence-mending mission.

The apology from Ron Baratz, issued by Netanyahu's office, cast a cloud over Monday's visit. Netanyahu and Obama have had a chilly relationship over the years, and the meeting is meant in part to repair ties after repeated clashes over the nuclear deal with Iran. In Washington, White House spokesman Josh Earnest said the apology was "warranted" but stopped short of opposing the appointment.

Netanyahu announced Baratz's appointment as his chief spokesman late Wednesday, and within hours, old Facebook posts had emerged in which Baratz suggested that Obama is anti-Semitic and Kerry is childish. He also derided Israel's popular president as "marginal."

Baratz's appointment still needs Cabinet approval. A government official, speaking on condition of anonymity because he was not authorized to discuss the issue, said a vote had not yet been scheduled, and that Baratz would not be joining Netanyahu on the trip to Washington.

"I have just read Dr. Ran Baratz's posts on the Internet, including those relating to the president of the state of Israel, the president of the United States and other public figures in Israel and the United States," Netanyahu said in a statement. "Those posts are totally unacceptable and in no way reflect my positions or the policies of the government of Israel. Dr. Baratz has apologized and has asked to meet me to clarify the matter following my return to Israel."

Baratz is the latest in a series of controversial appointments by Netanyahu. His ambassador to Washington, Ron Dermer, is a former Republican operative in the U.S. and spearheaded Netanyahu's speech to Congress in March arguing against the nuclear deal with Iran. The speech, arranged with Republican leaders in Congress, angered the White House and Obama did not attend.

Israel's new ambassador to the United Nations, Danny Danon, is an avid supporter of Israel's West Bank settlements and an equally fervent opponent of the establishment of a Palestinian state, putting him at odds with the international community.

Baratz, himself a West Bank settler, is a founding editor of a conservative website and former academic. Baratz recently said on his Facebook page that Obama's response to the Netanyahu speech in Congress this year was an example of "modern anti-Semitism in liberal Western states."

Baratz, 42, has also taken jabs at U.S. Secretary of State John Kerry, saying he should seek out a job as a stand-up comedian, insinuating his speeches are laughable.

In a 2004 column, Baratz voiced support for extremists pushing for a greater Jewish presence at a Jerusalem holy site. Israel is currently wracked by a wave of violence fueled by Palestinian allegations that Israel is plotting to take over the holy site. Israel denies the allegations.

Baratz's comments also generated anger at home for a Facebook post about Israel's largely ceremonial but much-admired president, Reuven Rivlin. He poked fun at Rivlin's penchant for flying coach on official trips, saying he is able to do so from a security standpoint because he is a "marginal figure." Rivlin's office said it asked the prime minister's office for clarifications.

In a new Facebook post, Baratz apologized for the "hurtful remarks" he had posted.

"I'm sorry that I didn't inform the Prime Minister in advance about them. These postings were written hastily and sometimes humorously, in a manner appropriate for a private person writing on the Internet," he said. He said it is "clear" he will have to behave differently in his official role, and that he would try to clarify things with Netanyahu.

Earnest said White House officials "have seen the reports about this individual's previous comments about U.S. officials and also seen the report about his apology, in this case it is readily apparent that that apology was warranted."

He added that "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."

The appointment was derided by commentators and questioned even by Netanyahu's allies. Two Cabinet ministers urged him to reconsider.

"This is the man the prime minister chose to be my mouthpiece, all of our mouthpieces, to talk to the world in our names. This man, with his words dripping with poison, his mouth is our mouth now," wrote satirist Mika Almog in the Yediot Ahronot daily.

If the Cabinet approves the nomination, Baratz will serve as spokesman for Israeli media and become a close adviser. Another Netanyahu spokesman deals with the foreign press.