The decision focused partly on a rocky and inhospitable island held by Ukraine and linked to the mythical Greek hero Achilles.
However, the final judgment made no mention of natural resources, and it was unclear how the new line would divide access to the region's estimated billions of cubic meters of natural gas and 10 million tons of oil.
Ukraine and Romania both welcomed the decision, though the U.N.'s highest judicial body largely discounted the arguments and maps they had presented to back their claims.
Romanian delegate Bogdan Aurescu said his side got nearly 80 percent of its claim over the 12,000-square-kilometer (4,633-square-mile) territory.
He said the decision could open new era of cooperation between the countries. Media in Bucharest suggested the region's energy resources could help Romania become less dependent on Russian natural gas.
Ukraine's Deputy Foreign Minister Oleksandr Kupchyshyn called the court's decision ''a wise compromise,'' and said geologists would determine how much energy potential each side could exploit.
The ruling gave Ukraine a large portion of the northeastern side of Romania's claim. ''We are satisfied that we have become party to this civilized solution,'' Kupchyshyn said.
The court's 15 justices unanimously adopted the binding decision, after the two countries had failed in 24 rounds of negotiation to settle the dispute that started shortly after the end of World War II.
The court rejected Ukraine's suggestion that the boundary run through Serpent Island, also known as Snake Island -- where legend says Achilles was buried. Ruins have been discovered of what of what is believed to have been an ancient temple to the Greek warrior with the vulnerable heel.
Romania said the rocky outcrop 23 miles (37 kilometers) off the coast and the mouth of the Danube was so small it didn't qualify as an island. The entire island was placed in Ukraine's portion of the sea.