Guatemala and Venezuela agreed to withdraw from the race for a seat on the U.N. Security Council Wednesday and support Panama as a consensus candidate, Ecuador's U.N. ambassador said.

With the backing of the two countries, Panama's election for a two-year term on the Security Council is virtually certain.

Click here to go to FOXNews.com's United Nations Center.

The announcement by Ambassador Diego Cordovez, who hosted two meetings Wednesday between the foreign ministers of Guatemala and Venezuela, ends a deadlock between the two countries that dragged on through 47 votes.

The voting has become highly political because the United States is supporting Guatemala over leftist Venezuela, which is led by the fiercely anti-American President Hugo Chavez, who referred to President Bush as "the devil" in his speech last month to the General Assembly.

With pressure mounting from Latin American countries to break the deadlock, Guatemalan Foreign Minister Gert Rosenthal and Venezuelan Foreign Minister Nicolas Maduro met Wednesday morning, and again for two hours late Wednesday afternoon to discuss withdrawing from the race and supporting a third candidate.

At the end of the meeting, Cordovez made the announcement saying, "The two candidates reached an agreement to step down and they came up with Panama as a consensus candidate."

He said Guatemalan Foreign Minister Gert Rosenthal and Venezuelan Foreign Minister Nicolas Maduro "will present Panama" to the 34 Latin American and Caribbean nations at a meeting on Thursday for their approval.

The Dominican Republic had emerged as the leading candidate so the choice of Panama was a surprise.

Asked why Panama had been selected, Rosenthal said: "It's a country that unites South America and Central America. We're concerned about the idea of divisions between the north and the south of Latin America. We would like to put that idea to rest by seeking a country that is well received at both extremes of our continent."

Supporters of both countries have refused to budge in the many rounds of voting. Guatemala led Venezuela in all but one of the 47 ballots on which they tied, but could not muster the two-thirds majority in the 192-member General Assembly to win the Security Council seat designated for a Latin American or Caribbean candidate.

Chile's U.N. Ambassador Heraldo Munoz, reflecting the views of many Latin American envoys, said Tuesday that there was no chance of either country winning the seat and it was time for the two countries to reach a political solution — which the region would almost certainly support.

Click here to go to FOXNews.com's United Nations Center.