The move, stripping Laurent Gbagbo, the Ivory Coast president, of almost all his authority, came on Wednesday in a resolution rewritten earlier in the day, following a deadlock over a previous draft written by France.
Critics had said the French draft gave the prime minister too much power.
The resolution extended Ivory Coast's transitional government for a second and final year - until October 31 next year - so that elections can be held and a democratically chosen government installed.
France had argued the resolution had to be adopted before the end of October 2006 to avoid a legal vacuum in the once prosperous cocoa-growing nation.
But the United States, Russia, China and Tanzania had threatened on Tuesday to abstain if the resolution were put to a vote without changes, arguing that as written, it impinged on Ivory Coast's constitution and its sovereignty.
Dumisani Kumalo, the South African ambassador, had on Tuesday dismissed the earlier text as "a regime change by the Security Council".
However, on Wednesday Kumalo embraced the compromise.
"It's better [because] it takes into account what the African Union has said," he said.
The earlier draft had stressed that Charles Konan Banny, the prime minister, needed to have "all the necessary powers, including appointment of civilian and military officials," to take the country through to elections.
As amended, the resolution deleted the reference to the appointment of civilian and military officials.
Ivory Coast slipped into civil crisis in 2002 after a coup attempt by dissident soldiers who tried to oust Gbagbo from power in the world's leading cocoa-producing country.
Following the failure of the coup, the New Forces rebels took control of the predominantly Muslim north, while Gbagbo's government remained in charge of the southern part of the country.