KYIV, Ukraine (AP) - David Cameron traveled Thursday to the Ukrainian port of Odesa in his first overseas trip as Britain's new foreign minister, and pledged that the U.K. would continue providing military support until Ukraine is victorious in its war with Russia.

Cameron, a former prime minister who returned to government in a surprise appointment Monday in a Cabinet shuffle, said he wanted to make Ukraine his first diplomatic destination, and met Wednesday with Ukrainian President Volodymyr Zelenskyy.

“I admire the strength and determination of the Ukrainian people,” he told Zelenskyy in a video posted by the president.

Cameron said the U.K. would continue to provide moral, economic and diplomatic support “but above all, the military support that you need not just this year and next year but however long it takes.”

The two-day visit came as Ukraine faces several challenges on and off the battlefield.

Zelenskyy has struggled to capture the world's attention as focus has shifted to the Middle East and Israel's war with Hamas. Additional U.S. funding for Ukraine is jeopardized by political fights in Washington and the European Union says it can't provide all the munitions it promised. Meanwhile, Ukraine's counteroffensive has led to only incremental gains and the ground war appears bogged down in a stalemate as winter arrives.

Western officials, speaking on condition of anonymity to discuss intelligence, said Thursday that the land war was likely to remain essentially stuck for the foreseeable future. One official said neither side was capable of mounting a decisive offense and Kyiv's counteroffensive had not changed Russian President Vladimir Putin's aim to control Ukraine.

Zelenskyy thanked Cameron for visiting and told him that the divided focus in the world does not help his cause.

“A good meeting,” Zelenskyy wrote on Telegram on Thursday. “Weapons for the front, strengthening of air defense, protection of our people and critical infrastructure. I am grateful to the UK for its support!”

Cameron said he wanted to find out what Ukraine needs from its friends and also make sure it is not forgotten on the world stage.

“Russia thinks it can wait this war out, and that the West will eventually turn its attention elsewhere,” Cameron said in a statement Thursday. “This could not be further from the truth. In my first discussions with President Zelenskyy in my new role, I made clear that the U.K. and our partners will support Ukraine and its people for as long as it takes for them to achieve victory.”

The U.K. has been one of the strongest supporters of Ukraine in defending itself from Russia.

As of last month, the U.K. said it was second to the U.S. in providing military funds to Ukraine, giving 4.6 billion pounds ($5.7 billion) worth of assistance and training 30,000 Ukrainian troops on British soil.

Cameron was prime minister when Russia illegally annexed the Crimean Peninsula in 2014. He launched a program to have the British Army train more than 22,000 Ukrainian soldiers.

After meeting with Zelenskyy and other officials on Wednesday, Cameron became the first U.K. minister to travel to the port city of Odesa since the war began.

The historic city on the Black Sea is home to the nation's busiest ports and serves as the one of the main shipping points for Ukrainian grain destined for world markets. The city and ports have come under fire since Russia in August declined to renew a deal allowing Ukraine to safely export grain via the Black Sea.

Cameron was shown how Ukraine is fighting back against Russia in the Black Sea to ensure that grain is still reaching countries in the developing world, his office said, though it provided no details.

Since the collapse of the grain deal, a new corridor in the Black Sea has allowed 91 ships to export cargo.

“In the last three months, Ukraine has made remarkable progress in the Black Sea to drive the Russian Navy eastwards and open critical export corridors for Ukraine's economy and global food supplies,” Cameron said.

--

Melley reported from London. Associated Press writer Jill Lawless in London contributed to this report.