The election of Panama as a non-permanent member of the Security Council has put an end to weeks of deadlock. The BBC's Laura Trevelyan looks at how the battle for Latin America's has reflected on the UN and what the new council will look like.
Guatemala v Venezuela will go down in history as one of the epic battles for a UN Security Council seat.
Hugo Chavez called US President Bush "the devil" at the UN
The two countries went 47 rounds before declaring a truce and agreeing to withdraw in favour of Panama - which has now been formally adopted in another vote.
It was not quite as drawn out as Cuba v Colombia in 1979, which dragged on for 154 rounds before Mexico was endorsed as the compromise candidate in round 155.
The spectacle of all 192 countries of the UN sitting in the great hall of the General Assembly and voting again and again with little change to the outcome was hardly the greatest advertisement for the world body.
The spokeswoman for the General Assembly had to fend off questions about whether it was true that each day of voting cost $25,000 (£13,100).
At a time when big donors like the US are calling for institutional reform, the scene played into the hands of those who believe the UN is hopelessly bureaucratic and ineffective.
The extremely high hurdle for getting a seat on the security council didn't help the situation - a two-thirds majority is required for victory, not a simple majority.
A two-thirds majority is needed to fill a UN Security Council seat
So even though Guatemala won 46 of the 47 rounds of voting and was consistently ahead of Venezuela that was not enough.
Latin American diplomats were also acutely aware of the way their countries were being portrayed.
One diplomat reflected ruefully that it was chaotic and disorganised, in contrast to the discipline of the African group which agrees years in advance the order in which African nations get to serve on the security council.
Sigh of relief
Now that the arm-twisting and the lobbying is done - what will the new Security Council look like in January?
The five permanent members - Britain, France, Russia, China and the US - who are able to veto decisions, will be joined by Panama, South Africa, Indonesia, Italy and Belgium. They will serve for two years.
Tanzania, Japan, Denmark, Greece and Argentina will stand down and Peru, the Democratic Republic of Congo, Ghana, Qatar and Slovakia stay on the council until the end of 2007.
Western diplomats will be breathing a sigh of relief that Venezuela failed in its bid for a platform from which to lead a bloc of developing countries against the US.
Five permanent members
Ten elected to serve two-year terms
Each year five elected members change, within regional blocs
Arab state always represented in Africa or Asia bloc
Panama, the tiny central American country which controls the all-important shipping canal, is not expected to fulfil the same role that President Hugo Chavez had envisaged for his country.
The US Ambassador to the UN, John Bolton, pointed out happily that Mr Chavez committed podiacide - shooting yourself in the foot - with his speech to the General Assembly in which he compared US President George W Bush to the devil.
Yet there is still the potential for new alliances on the security council which could prove troublesome to the US and Western European axis.
South Africa will be a powerful voice, ready to air the concerns of the developing world. The country's UN Ambassador Dumisani Kumalu is an articulate and influential force even before he sits on the security council.
Indonesia is a Muslim country which might occasionally join forces with Qatar.
Iran, North Korea, Darfur and the Middle East are all issues which are likely to come before the 15-member council.
Resolutions must pass with at least nine votes - if China, Russia, South Africa, Qatar and Indonesia form a bloc, the potential is there for lively debates.