Venezuela, whose president Hugo Chavez opposes the Bush administration, and Guatemala went through 48 rounds of voting over four weeks trying to secure the non-permanent council seat marked for the region.
But last week, the two nations gave up their rival bids for the seat to make way for Panama as a compromise candidate.
Panama will replace Argentina on the council from January 1 next year.
Guatemala had led Venezuela in all but one of the 47 ballots, but could not muster the two-thirds support needed to win in the General Assembly.
The standoff was the third-longest battle for a seat on the Security Council in the UN's 61-year history.
Ricardo Alberto Arias, Panama's UN ambassador, said his country presented its name in "a spirit of understanding the different conflicts that there are in the world, especially those caused by cultural and religious differences".
John Bolton, the US ambassador to the UN, welcomed Venezuela's failure to secure a non-permanent seat on the Security Council.
HI said that Caracas had only itself to blame after Chavez used a speech to the UN General Assembly to repeatedly call the US president "the devil".
"The Venezuelans defeated themselves through a variety of their tactics," Bolton said.
The US envoy had lobbied hard for Guatemala, fearing that Venezuela, under Chavez, would use a council seat to oppose US measures and openly attack the US.
But, he said, "the defeat of Venezuela certainly accomplishes our principal objective".
The influential Security Council is made up of 15 members, including five veto-wielding permanent members - Britain, China, France, Russia and the US - and 10 non-permanent members.