Sweden and Kazakhstan won contested elections for coveted seats on the Security Council on Tuesday and the Netherlands and Italy ended a battle for another seat by agreeing to split the two-year term on the U.N.'s most powerful body.

The U.N. General Assembly met to choose five new council members and it overwhelmingly elected Ethiopia and Bolivia, who faced no opposition for seats earmarked for Africa and Latin America and the Caribbean.

But after five rounds of voting, the Netherlands and Italy who belong to the Western group of countries were deadlocked with each receiving 95 votes -- and needing 127 votes to win.

After two recesses called by General Assembly President Mogens Lykketoft, the Netherlands and Italian foreign ministers announced the deal, saying Italy will hold the Security Council seat in 2017 and the Netherlands in 2018.

The agreement needs to be endorsed by the group of Western nations who will meet Wednesday morning and are virtually certain to approve it. Once that happens, Lykketoft is expected to resume the suspended assembly meeting to give its approval to the deal.

Splitting a two-year council term is not unprecedented. It happened on at least five occasions between the mid-1950s and mid-1960s when, for example, Czechoslovakia held the seat in 1964 and Malaysia in 1965.

Winning a seat on the Security Council is a pinnacle of achievement for many countries because it gives them a strong voice in matters dealing with international peace and security from conflicts in Syria to South Sudan to actions that threaten global stability such as North Korea's nuclear and ballistic missile tests and attacks by extremist groups such as the Islamic State.

The council also gets to authorize and oversee the U.N.'s far-flung peacekeeping missions.

The 15-member council includes five permanent members with veto power -- the U.S., Russia, China, Britain and France -- and 10 non-permanent members elected for two-year terms. Seats are allocated by region, and regional groups nominate candidates. Five countries are elected every year by secret ballot.

Heading into Tuesday's voting, a close race was expected in the Western group with Sweden, the Netherlands and Italy competing for two seats. Sweden won on the first ballot with 134 votes but the Netherlands and Italy remained neck and neck.

Dutch Foreign Minister Bert Koenders announced the deal to split the term to the assembly to loud applause saying the 95-95 vote was "a clear signal that you appreciate both countries." Italy's Foreign Minister Paolo Gentiloni then said both countries "wanted also to give a message of unity between two European countries."

In the other contested race for an Asian seat, Kazakhstan defeated Thailand in the second round by a vote of 138 to 55. Human Rights Watch had criticized the human rights record of both countries.

Looking ahead to being on the council next year, Sweden's Foreign Minister Margot Wallstrom said "with 40 conflicts and 11 full-blown wars, it is a very, very worrisome world that we have to take into account."