The US Senate has confirmed former treasury secretary Jack Lew as the new US Ambassador to Israel.
President Joe Biden nominated Mr Lew, an Orthodox Jew who held top posts in prior administrations, in September.
The White House urged Congress to confirm him quickly after Hamas's attack, as "high-level diplomatic representation" is "critical".
The Senate voted largely on party lines, with Democrats and two Republicans backing Mr Biden's choice.
Mr Lew needed a simple majority in the 100-member Senate for his appointment to be confirmed.
Who is Jack Lew?
Raised in an observant Jewish family in New York, Mr Lew, 68, has maintained a low profile in Washington, D.C., despite a career that boasts several important postings.
Under Presidents Bill Clinton and Barack Obama, the longtime civil servant led the Office of Management and Budget, which oversees the president's budget requests.
Mr Lew later served for a year as President Obama's White House chief of staff, one of the most influential cabinet positions. A budget expert, he was then appointed as treasury secretary in 2013 and served in that post until 2017.
That appointment process was memorable for the criticism of his illegible loopy signature, as it would appear on American currency if he became secretary. He quickly adopted a more traditional sign-off.
Mr Lew began his career in politics in 1973. He worked for eight years as the primary domestic adviser to House Speaker Tip O'Neill, an iconic and powerful Democrat.
Lew's view of Israel and Palestinians
Mr Lew has previously spoken in support of a two-state solution. He openly criticised Israel and its conservative prime minister, Benjamin Netanyahu, while working under President Obama.
He also defended the US's 2016 decision not to veto the UN Security Council condemnation of Israeli settlements on occupied land.
During his recent nomination hearing, however, Lew said he has "worried deeply about the survival of the State of Israel" throughout his life. Growing up, he said, his family believed deeply in the creation and defence of a Jewish homeland.
That background and Hamas's attack informed Mr Lew's view of the post's important responsibility, he said.
"At this moment, there is no greater mission than to be asked to strengthen the ties between the United States and the State of Israel and to work toward peace in a region that has known so much war and destruction," he said in his opening statement to the Senate Foreign Relations Committee.
Mr Lew said that as ambassador he would work "to end the horrific attacks by Hamas" and make sure Israel has all "it needs to defend itself". He said he would strive to help American captives return home.
He also said he would do everything in his power to stop the conflict from expanding, aid innocent Palestinians trapped in Gaza, and stymie the influence of Iran, which he called "a threat to regional stability and to Israel's existence".
More on Israel-Gaza war
Follow live: Latest updates
History behind the story: The Israel-Palestinian conflict
The hearing and Republican opposition
Senate Democrats had stressed their desire to get Mr Lew into the ambassador's post, which was vacated in July, as quickly as possible.
Republicans, however, expressed reservations and in some cases hostility to the appointment.
Mr Lew sparred with Republicans during his hearing over his work on the Joint Comprehensive Plan of Action, commonly known as the Iran Nuclear Deal.
The agreement, which included the UK, the US and several European countries, limited Tehran's nuclear programme. In return, Western countries and the UN agreed to eventually lift sanctions and unfreeze Iranian funds.
Jim Risch, the top Republican on the Senate Foreign Relations Committee, said he had "reservations" over Mr Lew because of his involvement in the deal as President Obama's Treasury Secretary: "Holding hands with Iran under the table doesn't work for me."
Republicans have long opposed the Iran Nuclear Deal, arguing it did not do enough to ensure Tehran would not develop a nuclear weapon and gave the government too much financial support. Donald Trump famously pulled the US out the agreement early in his administration.
Other Senate Republicans claimed the deal had allowed Iran to fund groups like Hamas. A few also suggested Mr Lew had misled Congress when testifying about the agreement as secretary.
Mr Lew disputed the claims, arguing that all Iran gained was access to "their money that we had frozen". Iran agreed to the terms but was unhappy with the outcome, he said.