Somalia President Mohamed Farmaajo Thursday used his inaugural address to the United Nations to reject Kenya's call for maritime boundary dispute.
President Uhuru Kenyatta had earlier said he was open to anything, though emphasising on dialogue as the best option to find a solution.
"I have always believed and stood my ground that dialogue is the best and amicable way for finding the best and positive solution. This brings us together as opposed to a conflict that pushes away from each other," Mr Kenyatta said.
The two countries are fighting over maritime boundary in the Indian Ocean.
Mr Farmaajo said the matter was in court and that the International Court of Justice (ICJ) should be the ultimate arbiter because talks between the two countries have collapsed completely.
He said when bilateral negotiations did not achieve an agreement for peaceful cohesion, in 2014 and in conformity with international law, Somalia instituted proceedings before the ICJ, the highest legal authority of the United Nations.
"We are very pleased that the court found that it had jurisdiction to resolve the dispute and that is scheduled for the final hearing for the merit case in November this year," he said.
Somalia, a member of the United Nations and a party to the statue of the court, is committed to see through the judicial settlement process, Mr Farmaajo said.
Somalia, he said, will comply with the court's final judgement and accept the outcome on the boundary that is delimited by the court.
The firm-talking president added that as a matter of international law, the court's judgement will be binding on Kenya as well.
"We trust that when that judgement will be issued and the boundary established, a lasting settlement of this long-lasting dispute will finally be achieved. We are will abide by the court ruling," he said.
This was the first time Mr Farmaajo was addressing the UN General Assembly after his election in 2017.
It appeared that podium which was full of Somalia citizens offered the best opportunity for him to play both domestic and regional politics on the maritime row.
Domestically, many Somalis had been questioning his commitment to defending Somalia's territorial integrity, especially after holding the much-publicised meeting with President Kenyatta.
The Somali leader also rejected African Union's push for dialogue touted as African solutions for African problems.
Mr Farmaajo got the crowds' support when he said that the AU had no capacity and is not empowered to intervene in the case that is before the UN court.
But Mr Kenyatta said that the AU Peace and Security Council during the September 2019 meeting had given them a go-ahead to engage and negotiate.
The AU chairman, Egypt's President Abdel Fattah al-Sisi, had brokered talks between the two leaders on Tuesday evening on the sidelines of the UN General Assembly convention in New York in which Somalia and Kenya said was the first step to normalise relations.
In the first face-to-face meeting since March, the two leaders agreed to thaw frosty relations as they fight over the flow maritime boundary.
Mr Farmaajo acknowledged that the meeting was "very fruitful" though he would not withdraw the case from court.
"We agreed to restore our good relationships in strengthening diplomatic and political cooperation and leave the maritime dispute between the two countries to be resolved by the International Court of Justice," he said.
He added that Somalia is committed to maintaining a good relationship with Kenya provided that the boundary is solved in court.
"I would like to further report that the 74th United Nations meeting was very fruitful and that we will continue to be very good friends," Mr Farmaajo said during his address.
The decision is believed to be politically motivated and may impact the 2021 elections results.
"If he accepts to go the dialogue way, he might lose the election for 2021. There are forces behind this and it is not politically sound for him to accept dialogue. It will not go well with the people of Somalia who are mounting pressure on him to take Kenyans to court," said a source privy to the information in his government.