Hobbled by internal unrest and accusations of human rights violations, Maldives has lost its bid for Asia's Security Council seat, which Indonesia won by a huge margin.
Indonesia received 144 votes, more than the required 127 for a two-thirds majority, while Maldives got only 46 votes in the elections on Friday.
The Asian seat was the only one of the five that was contested this year as there was unanimity in their respective blocs for the other four regional seats.
South Africa won the African seat, Dominican Republic the Latin American and Caribbean representation, and Belgium and Germany the two Western European and Others Group (WEOG) seats.
They all, however, had to get two-thirds of the votes in the General Assembly which has 193 members of whom 190 participated in the voting.
They will serve a two-year term in the Council in 2019 and 2020.
Of the 10 non-permanent seats, five come up for election every year.
Israel, which belongs to the WEOG had announced that it was running for one of the two seats but pulled out after it became clear that it would not get enough votes to be elected.
Indonesia will replace Kazakhstan, whose term will be over at the end of 2018.
The other non-permanent Asian member of the Council is Kuwait, whose term runs through 2019.
While Indonesia in its own right is an important international actor, the internal conflicts in the Maldives that came to a head in February ended whatever chances it may have had.
President Yalla Yameen imposed a 45-day state of emergency and had the Chief Justice of the Supreme Court arrested in February and problems have continued with the Election Commission refusing to recognise the victory of former President Mohamed Nasheed in the primary election of his Maldivian Democratic Party.
Many Maldivians campaigned on social media against their country citing its human rights abuses and the suppression of democracy, which they said made it unfit to serve on the Council.
Indonesia made a big push for its election, with the lobbying efforts headed by Foreign Minister Retno Marsudi at the UN.
She herself met more than 30 representatives of countries at different levels this week and phoned others.
This was the fourth time Indonesia has been elected to the Council.
After the election, Marsudi said that it was "a statement of confidence in our commitment and capacity" by the international community.
One of Indonesia's priorities on the Council would be combating terrorism and radicalism through a comprehensive global approach that addresses their root causes, she said.
Both she and South Africa's Foreign Minister Lindiwe Sisulu said their countries would work to empower women and ensure their concerns had a voice in the Council.