(Bloomberg) -- The International Court of Justice rejected Kenya’s territorial claims in a maritime border dispute with Somalia, in a ruling that may inflame tensions between the nations eyeing the area’s oil and gas reserves.

The ruling read by Judge Joan Donoghue on Tuesday was largely in favor of Somalia, with the Hague-based court saying that there isn’t a boundary agreement between the nations as earlier claimed by Kenya. 

Kenya signaled on Oct. 8 it wouldn’t accept a ruling by the court because it had withdrawn its recognition of its compulsory jurisdiction. Whatever the outcome, the ruling will have “profound” security and economic ramifications in the region, its foreign ministry had said. The department didn’t immediately respond to a request for comment after the ruling on Tuesday.

The controversial case opened in 2014 when Somalia challenged a 2009 accord that set its maritime border along latitudinal lines, with Kenya claiming ownership of a 150,000 square-kilometer (58,000 square-mile) zone potentially rich in hydrocarbons and fish. International energy companies including Anadarko Petroleum Corp, TotalEnergies SE and Eni SpA have shown interest in exploring in the area.

The ICJ adjusted the maritime boundary, moving a chuck of territory that Kenya claimed to Somalia. The new line established “achieves an equitable solution,” the court said.

Somalia has succeeded in regaining its seas through struggle and sacrifice, Information Minister Osman Dubbe said on Twitter.

Somalia wants to tap the resources to help rebuild its economy following decades of civil war and an ongoing conflict with al-Qaeda linked insurgents, and amid the threat from swarms of locusts on its farmlands. Kenya, East Africa’s largest economy, is struggling to boost revenue and to fund an infrastructure development program while keeping its debt under control.

The Hague-based court’s ruling heightens security concerns. Kenya and Somalia have for several years collaborated in the fight against the al-Shabaab insurgents responsible for terrorist incidents in both countries, including a raid on Nairobi’s Westgate shopping mall in 2013 that killed at least 67 people. 

A breakdown in cooperation because of the border dispute could embolden the militant group.

“The political stakes of this case are sky-high in both countries,” said Meron Elias, Horn of Africa Researcher at the International Crisis Group. “There is a risk the Court’s decision could be followed by a further slide in the relationship between Somalia and Kenya.”

(Updates with comments from the Court, Somalia government and an analyst throughout)

©2021 Bloomberg L.P.