The court discounted arguments and maps presented by both countries and drew a maritime boundary between the rival claims.
At stake is access to billions of cubic meters of natural gas and and an estimated 10 million tons of oil, but it was unclear how the new line would divide those resources.
Romania said it got 79% of its claim. But Ukraine's deputy foreign minister Oleksandr Kupchyshyn said both parties were satisfied with the judgment, which he called "a wise compromise."
The decision Tuesday by the court, the U.N.'s highest judicial body, is final and binding on both sides.