In tightly contested elections on Friday for the UN Security Council, Morocco was one of the few clear winners, with 151 of the 193 assembly members supporting it.
Morocco joins Pakistan, Togo and Guatemala on the 15 seat council, for a term for 2012 and 2013. It has been elected twice before - the last time in 1992-1993.
Moroccan Foreign Minister Taib Fassi Fihri said that the country had triumphed, "despite the attempts which have been made, but in vain, to exclude Morocco from this competition" because it did not belong to the African Union.
The only African countries endorsed by the AU were Togo and Mauritania. Morocco pulled out of the organisation's predecessor, the Organisation of African Unity, in 1984, over a dispute with the Algerian-backed Polisario Front Morocco's huge victory will boost Rabat in its continuing problems with the Polisario.
"Today a broad majority of African states decided to show solidarity with Morocco, to show confidence in Morocco, to support Morocco", Mr Fassi Fihri said. "Our candidature was legitimate because of the principle of rotation."