Moscow has been told by a maritime tribunal it must release 24 sailors that were aboard vessels it intercepted in the Kerch Strait in November 2018.
The Russian navy captured the sailors and their three vessels after opening fire on them in the strait, located between Russian-annexed Crimea and southern Russia.
The Hamburg-based International Tribunal for the Law of the Sea (ITLOS) said Russia must release the seamen immediately and that both countries should refrain from doing anything to aggravate relations.
"The Tribunal notes that any action affecting the immunity of warships is capable of causing serious harm to the dignity and sovereignty of a state and has the potential to undermine its national security," said Jin-Hyun Paik, ITLOS President.
Moscow has not heeded calls from Ukraine, the European Union nor the USA to return the sailors and impounded ships.
The Russian Foreign Ministry said on Saturday that ITLOS lacked the jurisdiction to rule on the matter.
Both Russia and Ukraine have the right to use the Sea of Azov, which connects them and is linked by the Kerch Strait to the Black Sea, but tensions have been high since Russia annexed Crimea.
The two countries have protested over delays to shipping and harassment.
Russia's FSB security service said it had been forced to act in November when the Ukrainian vessels illegally entered its waters.
Ukraine's deputy foreign minister, Olena Zerkal, wrote in a post on Facebook, that the Tribunal's order sent "a clear signal to Russia that it cannot violate international law with impunity," adding she expected Moscow to act quickly in line with the order.
Russia annexed Crimea in 2014 and has said it will never give the area back to Ukraine, accusing Kyiv of staging a provocation in the Kerch Strait.