The top U.N. top court ruled on Tuesday largely in favour of Somalia in its dispute with Kenya, setting a sea boundary in part of the Indian Ocean believed to be rich in oil and gas.
Somalia said the ruling was a result of "sacrifice and struggle" by the Horn of Africa country.
A new boundary drawn by the International Court of Justice was closest to a line proposed by Somalia, attributing to it several offshore oil blocks claimed by Kenya.
The revised maritime border along the exclusive economic zones for the continental shelves of Somalia and Kenya "achieves and equitable solution", Judge Joan Donoghue said.
Kenya, which did secure some territory beyond the Somali claim, had failed to prove there was an established sea boundary between the states, which would have given it a greater portion of the disputed territory, the court found.
"I thank Allah for ... for the fruit of the long struggle made by the Somalis in preventing Kenya's desire to claim ownership of part of Somalia's sea," Somalia's President Mohamed Abdullahi Mohamed said in a broadcast on his office's Facebook page.
The ruling came after Nairobi last week said it had revoked recognition of the court's jurisdiction. No one for Kenya was officially present either in court or via video link.
The court has said Kenya's withdrawal is not retroactive and does not affect Tuesday's judgement.
Somalia filed the case in 2014 at the United Nations' highest court dealing with disputes between states.
The case at the ICJ, also known as the World Court, concerned a boundary dispute over more than 100,000 sq km (nearly 40,000 sq miles) of sea floor claimed by both countries.
Reporting by Stephanie van den Berg, Additional reporting by Abdi Sheikh in Mogadishu and George Obulutsa in Nairobi Editing by Anthony Deutsch, Peter Graff, Chizu Nomiyama, Mark Heinrich and Giles Elgood.