The first cargo of Ukrainian corn to be exported via the Black Sea since Russia’s invasion set sail from a Romanian port Friday, according to the port’s operator, dodging a Russian naval blockade that has all but halted Ukraine’s grain exports.

The 71,000 metric ton cargo of Ukrainian corn left the port of Constanta on a bulk carrier early Friday, said Viorel Panait, director of Comvex SA, which operates the port.

Ukraine was one of the world’s biggest exporters of grain before Russia’s invasion. It was the fourth-largest exporter of corn, behind the U.S., Brazil and Argentina, as well as a major exporter of wheat, according to the U.S. Department of Agriculture.

But Russia’s invasion has damaged Ukraine’s farms and choked the flow of agricultural commodities that used to leave its Black Sea ports, helping to drive grain prices higher and adding to concerns about global food security.

With grain building up at silos inside the country, traders, farmers and the Ukrainian government have been exploring alternative export routes.

Constanta, a Black Sea port fewer than 100 miles from Ukraine that is connected to Ukraine via the Danube River, has proved to be one such route. Polish ports on the Baltic Sea are another being considered.

The sudden redirection of Ukrainian grain exports has caused logistical headaches. Ukraine’s railway infrastructure has struggled to cope, particularly as its Soviet-era tracks are a different gauge to those found in neighboring nations.

Friday’s corn shipment was the first to be successfully exported from Ukraine via the Black Sea since the war began, Mr. Panait said. A steady flow of Ukrainian grains was making its way on barges down the Danube to Constanta, he said.

“We’ve made a lot of effort to establish this flow of cargo because we all feel here that Ukrainian people need this help,” he said.