Guatemala and Venezuela both decided to withdraw from the deadlocked UN Security Council race and accept Panama as their compromise choice for Latin America's seat.
The decision on Wednesday ended nearly two weeks of stalemate in the UN General Assembly, which held 47 ballots without neither Guatemala nor Venezuela reaching the two-thirds majority needed to win the Security Council seat, which is being vacated by Argentina on December 31.
The decision was announced by Diego Cordovez, Ecuadorian ambassador to the United Nations, who mediated talks between Foreign Ministers Gert Rosenthal of Guatemala and Nicolas Maduro of Venezuela at the Ecuadorian diplomatic mission at UN headquarters in New York.
"They have agreed that Panama will be the country that will replace them as a candidate for the Security Council," Cordovez said.
Cordovez said earlier that the two sides were convinced that they would both have to drop out of the race and accept a compromise to break the deadlock.
Both countries had earlier asked the 192-nation General Assembly to suspend voting on the vacant spot until next week to allow more talks, which could result in a third country being chosen as a compromise.
Since the General Assembly began voting on Oct 16, neither Guatemala nor Venezuela had been able to garner the required two-thirds majority of 124 votes to win the Security Council seat.
Venezuelan President Hugo Chavez, a leftwing leader, has been seeking a Security Council seat while loudly criticising US President George Bush, branding him "the devil" in a General Assembly address in September.
The speech may have cost Chavez the Security Council seat, which he had said he would use to launch reforms to curb US influence at the UN and in the world.