The Russian army said on Thursday that it had withdrawn from Snake Island, a strategic position in the Black Sea conquered by Moscow which had come under Ukrainian shelling in recent weeks.
The defence ministry in Moscow said the move was "a sign of goodwill" and aimed at facilitating grain exports.
But Ukraine's military said a barrage of Ukrainian artillery and missile strikes forced the Russians to flee the island in two speedboats.
The small island became emblematic on the first day of the Russian offensive when a member of the small Ukrainian garrison defending it used an expletive in response to Russian demands they surrender.
Andriy Yermak, head of Ukrainian President Zelenskyy's office, hailed the Russian withdrawal. "KABOOM!" he tweeted. "No Russian troops on the Snake Island anymore. Our Armed Forces did a great job."
The version of events from Moscow is that Russian forces left Snake Island voluntarily, linking the withdrawal to Western accusations that Russia has been blockading Ukrainian ports and preventing agricultural exports.
"On 30 June, as a sign of goodwill, the Russian armed forces fulfilled their objectives on Snake Island and withdrew their garrison there," said Russian defence ministry spokesman Igor Konashenkov.
"Russia does not oppose UN efforts to create a humanitarian corridor to export grain from Ukraine," he said.
Earlier on Thursday, authorities appointed by Moscow in Berdyansk — several hundred kilometres to the east in the Sea of Azov — said that a merchant ship carrying 7,000 tonnes of grain had left the Russian-occupied Ukrainian city, protected by the Russian navy and heading for "friendly countries".
Ukraine has accused Russia for weeks of stealing its wheat crops from areas occupied by the Russian army in southern Ukraine and illegally selling it internationally. Moscow denies any theft.
Konashenkov added that the withdrawal from Snake Island would "no longer allow Kyiv to speculate about an imminent food crisis" by claiming it was impossible to export grain because of Russian control of the area.
The island, located in the northwestern Black Sea near the Ukrainian and Romanian coasts, was conquered by Moscow at the start of the offensive in Ukraine launched on 24 February.
In what became seen as a symbol of Ukrainian resistance, an initial Russian demand that Ukraine's troops on the island surrender or face bombardment brought a defiant response. "Russian warship," the answer came back, "go (expletive) yourself".
The Ukrainian defenders of the island were captured by the Russians but later freed as part of a prisoner exchange. The island has since been regularly targeted by Ukrainian drone and missile strikes.
On 21 June, Russia claimed to have repelled a "crazy" attempt by Kyiv's forces to retake Snake Island.
"The fight over Snake Island reveals something that seems to be a pattern in this war," tweeted Philips P. O'Brien, Professor of Strategic Studies at the University of St Andrews.
"If the Russians can’t rely on overwhelming artillery firepower, they struggle (to) accomplish anything. In any engagement requiring initiative and adaptability, the Ukrainians seem to prevail."