Israeli Prime Minister Naftali Bennett traveled to Moscow to meet Russian President Vladimir V. Putin at the Kremlin, according to Israeli and Russian officials, a rare moment of diplomacy in a war that has dragged into its second week.

“The situation around Ukraine is being discussed,” Kremlin spokesman Dmitry Peskov told reporters, according to state-controlled news site RIA Novosti.

The meeting comes at a critical time in the war, as Russian forces encircle major cities and Ukraine reels in a humanitarian crisis. Russian and Ukrainian diplomats are continuing bilateral talks, but several diplomatic overtures by third parties, including efforts by French President Emmanuel Macron, have stalled.

Israel is in a unique position to potentially barter a deal, or at least send messages between Western allies Russia and Ukraine, given its alliance with the United States, its quiet cooperation with Russia in Syria and its shared cultural ties with Ukraine. Mr. Bennett and Ukrainian President Volodymyr Zelensky are the only two Jews in the world to head national governments.

Mr. Bennett’s office said in a statement on Saturday evening that the meeting with Mr. Putin lasted about three hours and took place “in coordination and with the blessing of the US administration”. In addition, the statement added, Mr. Bennett was working in coordination with Germany and France and was “in permanent dialogue with Ukraine”.

There was no immediate information on the results of the meeting. A spokeswoman for Mr. Bennett said he spoke with Mr. Zelensky after his meeting with Mr. Putin.

The Israeli government has tried to maintain good relations with Russian and Ukrainian leaders during the current crisis, and Mr. Bennett had previously been invited by Mr. Zelensky to mediate between the parties.

Mr Bennett left Moscow on Saturday evening to travel to Berlin to meet German Chancellor Olaf Scholz. Mr. Scholz was in Israel for a short visit this week and, in a meeting with Mr. Bennett, discussed Israel’s possible role in mediating between Russia and Ukraine.

Mr. Bennett had spoken by phone with Mr. Putin on Wednesday, hours after speaking with Mr. Zelensky, the latest of a few rounds of phone conversations between them.

In a sign of the mission’s urgency, Mr. Bennett, an observant Jew, left Israel Saturday morning over the Sabbath, breaking the religious injunction banning travel. According to Jewish religious law, the sanctity of the Sabbath is superseded by the principle of preservation of human life.

Mr. Bennett was accompanied by Zeev Elkin, Israel’s housing minister, who helped with the translation, according to the Israeli prime minister’s office. Mr. Elkin has frequently acted in a similar capacity over the past decade in meetings between Mr. Bennett’s predecessor, Benjamin Netanyahu, and Mr. Putin.

Mr. Elkin, who is also an observant Jew, was born in Kharkiv, Ukraine, in 1971, when it was part of the Soviet Union, and emigrated to Israel in 1990. Mr. Elkin has a brother who still lives with his family in Kharkiv, where Russian and Ukrainian forces are fighting for control.

The Israeli delegation also included the prime minister’s national security adviser, Eyal Hulata, his diplomatic adviser, Shimrit Meir, and his spokesperson, Matan Sidi.

Mr Bennett had faced criticism in recent days, including from Mr Zelensky, for not taking the more vocal side of Ukraine and for refraining from supplying him with material military.

Israeli officials have said Israel must maintain good relations with Russia so that it can continue Israel’s military campaign against entrenching Iran and Hezbollah in Syria, where Russia maintains a significant presence.

They said Israel was also concerned about large Jewish communities in Russia and Ukraine. After Saturday’s meeting at the Kremlin, Mr. Bennett’s office said he also spoke with Mr. Putin about the situation of Israelis and Jewish communities following the conflict in Ukraine.

Saturday’s meeting comes after several requests by Mr. Zelensky, to both Mr. Netanyahu and Mr. Bennett, to mediate between him and Mr. Putin. The latest request was made in a telephone conversation held on February 25, during which Mr. Zelensky also asked for military equipment. While refusing to send defensive equipment, Mr Bennett agreed to try to mediate between the countries.

Several rounds of phone conversations followed between Mr. Bennett and Mr. Putin, between Mr. Bennett and Mr. Zelensky, and between officials in their teams. Israeli officials believe Israeli mediation had some effect in getting Ukraine to agree to start talks with Russia in Belarus.

Mr. Hulata, Israel’s national security adviser, briefed the White House National Security Council on developments since the telephone conversation with Mr. Zelensky.

Israeli officials said the Kremlin meeting also touched on the progress of talks in Vienna for a return to a nuclear deal with Iran, and Mr Bennett voiced Israel’s opposition to a return to the nuclear deal. ‘OK.