Omah Guelleh has appealed to the UN to act on the Djibouti-Eritrea dispute
Djibouti's president has said his country will have to go to war with Eritrea unless the UN acts to resolve growing tension over a border dispute.
Djibouti has accused Eritrea of invading its territory and its ambassador to the UN told the BBC that Eritrea had been avoiding mediation.
But his Eritrean counterpart said Eritrea had no territorial ambitions.
Both France and the US have troops in Djibouti. Its border with Eritrea is at a key strategic point on the Red Sea.
Djibouti's President Omah Guelleh appealed on Thursday to the UN Security Council to help resolve the dispute.
"Continued inaction in whatever form not only will encourage but will benefit Eritrea's attitude," he said.
"This would only give my country one option, the option of war."
But Eritrean ambassador Araya Desta said his country wanted "the cultivation of good neighbourly relations with Djibouti".
"Contrary to the claims made, Eritrea has not taken any land that belongs to Djibouti and it does not have any territorial ambitions," he said.
Mr Desta instead accused Ethiopia of moving troops to high ground on the border of the three countries.
"Ethiopia has built from the Djiboutian side a network of winding roads up the mount and deployed offensive long-range artillery and heavy equipment directed at Eritrea," he said.
Since Eritrea gained independence in 1993, the Horn of Africa country has been involved in two serious conflicts over territory with its neighbours.
Clashes between Eritrea and Djibouti earlier this year left nine Djiboutian troops dead and 60 injured.
In June, the UN Security Council called on Eritrea and Djibouti to agree to a ceasefire, stressing that Eritrea should pull its forces back, the BBC's Laura Trevelyan reports from the United Nations.
France, the former colonial power in Djibouti, is working on presenting a plan to the Security Council reiterating demands for Eritrea to withdraw its forces, she says.
France also wants the two sides to talk to each other about their disputed border.
Djibouti's ambassador to the UN, Roble Olhaye, said Eritrea had "refused or rebuffed all international mediation".
"For the last four months all international organisations have been trying to talk to them," he told the BBC's Network Africa programme.
"All regional organisations have been trying to send missions to [Eritrea's capital] Asmara and they did not even issue them visas."
He also dismissed the claim about Ethiopia amassing its forces.
"Whatever the Eritrean ambassador has said is hogwash," he said.
But Mr Desta said Eritrea refused to be drawn into what he called a "fabricated conflict".