KYIV, Ukraine -- British Foreign Secretary David Cameron vowed to maintain military support for Ukraine during a surprise visit to Kyiv announced on Thursday, with the West's attention focused on the Middle East.

This handout picture taken and released by Ukraine Foreign Ministry press-service on November 16, 2023 shows Ukrainian Foreign Minister Dmytro Kuleba (L) and British Foreign Secretary David Cameron (C) visiting the Opera and Ballet Theatre in Odesa. (Photo by Handout / UKRAINE FOREIGN MINISTRY / AFP)

Former prime minister Cameron was in Kyiv and also visited the southern port city of Odesa on his first trip abroad as foreign minister of the UK, which has been a staunch ally of Ukraine since Russia invaded.

"We will continue to give you the moral support, diplomatic support, the economic support, but above all, the military support, that you need not just this year, and next year, but for however long it takes," Cameron said during a meeting with Zelensky.

"Russia thinks it can wait this war out, and that the West will eventually turn its attention elsewhere. This could not be further from the truth," he added in a separate statement.

His visit, nearly two years into Russia's invasion of Ukraine, came with global attention shifting to the conflict between Israel and Hamas.

Zelensky thanked Cameron for making the trip while the world's attention was focused on more than one month of brutal fighting between Israel's army and Hamas.

"Now you know the world is not focused on the situation on our battlefield in Ukraine and dividing the focus really does not help," he told Cameron in a video distributed by the presidency.

- Drone barrage -

He added that the two men had had a "good meeting" that focused on "weapons for the front line, strengthening air defence, and protecting our people and critical infrastructure".

Cameron's backing for Ukraine came with concern building among Kyiv's allies over minimal military advances in recent months.

Neither Russia nor Ukraine has made any significant territorial gains for a year, and Kyiv's top army commander said that fighting had ground to a stalemate.

But there are growing reports that Ukrainian forces have gained a foothold on the eastern bank of the Dnipro river in the south of the country, which Kyiv hopes could pave the way for substantial Ukrainian advances towards Crimea.

Ukraine's Foreign Ministry also said Cameron had attended talks with his counterpart Dmytro Kuleba on issues related to weapon deliveries, arms production, and maritime security in the Black Sea.

The Foreign Office said Cameron had visited the port of Odesa on Thursday -- the second day of the visit -- and hailed new measures to insure cargo ships utilising Ukraine's ports despite Russian military threats.

"This step will be of great importance for Ukraine's export earnings and its economic recovery," said Cameron, according to a Ukrainian Foreign Ministry statement.

Zelensky meanwhile hailed efforts to restart shipping routes on the Black Sea after Russia earlier this year exited a deal safeguarding grain exports from Ukraine's ports.

"We have been able to provide such protection to the western part of the Black Sea, which now enables our maritime export corridors to operate," he told representatives of countries on the Black Sea.

Cameron earlier met with Deputy Prime Minister Olga Stefanishyna, London said, to discuss Ukraine's aspirations to join the US-led NATO alliance.

"The UK is clear that Ukraine's rightful place is in NATO and is working with Allies to smooth the path to Ukraine's accession by removing the need for a Membership Action Plan," Cameron was cited as saying.

The announcement of Cameron's visit came as Ukraine's air force said air defence systems had downed 16 Russian attack drones overnight, as well as one cruise missile.