The British PM said the United Kingdom stands with Israel after the "unspeakable, horrific act of terrorism" carried out by Hamas, a proscribed terror group which has taken around 200 hostages, including two Britons.
After meeting Israeli Prime Minister Benjamin Netanyahu and President Isaac Herzog, Mr Sunak then flew to Saudi Arabia to speak with Crown Prince Mohammed bin Salman.
Mr Sunak told Israeli President Herzog he has "not just a right" but a "duty" to "restore security to your country" after Hamas launched an unprecedented attack in southern Israel nearly two weeks ago.
He said: "We will stand with you in solidarity with your people and your right to defend yourself to bring security back to your country, to your people, to ensure the safe return of the hostages that have been taken and I know we will talk further about that later on."
Mr Sunak added: "You have not just a right to do that, I think you have a duty to do that, to restore that security to your country."
During a meeting with Mr Netanyahu, the prime minister expressed his gratitude for the Israeli government's support of "British nationals caught up in this horror, including your efforts to release the hostages".
Mr Sunak told a press conference alongside Mr Netanyahu that he wanted to "share the deep condolences of the British people" for the loss of life in Israel.
He said he wanted to "stress that we absolutely support Israel's right to defend itself in line with international law, to go after Hamas, to take back hostages, deter further incursions and strengthen your security for the long term".
"Now, I know that you are taking every precaution to avoid harming civilians - in direct contrast to the terrorists of Hamas, which seek to put civilians in harm’s way," Mr Sunak added.
"But I also want to thank you for the support that your government has given to the families of British nationals caught up in this horror, including your efforts to release the hostages, to secure their release.
"And I know that we will continue to co-operate, particularly with regard to British nationals that are involved."
Meanwhile, following the prime minister's meeting with the Saudi crown prince, No 10 said the pair agreed that the "loss of innocent lives in Israel and Gaza over the last two weeks has been horrific".
Mr Sunak "encouraged the crown prince to use Saudi's leadership in the region to support stability, both now and in the long-term", No 10 said.
Want a quick and expert briefing on the biggest news stories? Listen to our latest podcasts to find out What You Need To Know...