Zimbabwe's parliament has unanimously approved a constitutional amendment allowing opposition leader Morgan Tsvangirai to become prime minister.
The move allows a power-sharing deal to go ahead with Zanu-PF leader Robert Mugabe remaining the president.
Mr Mugabe is expected to sign the amendment on Friday and Mr Tsvangirai is due to be sworn in on 11 February.
The power-sharing deal was agreed in September 2008 but has been mired by bitter disputes.
Last week, southern African leaders, who have been mediating the deal, persuaded Mr Tsvangirai's Movement for Democratic Change (MDC) to join a joint administration despite their concerns over Zanu-PF's commitment to sharing power.
The unity government is intended to ease Zimbabwe's economic meltdown but correspondents say this is largely dependent on the restoration of foreign aid and investment.
Donors say they will only restore aid when the government is working efficiently and equally.
Zimbabwean journalist Brian Hungwe told the BBC that all 184 MPs and 72 senators had approved the bill.
Reuters news agency reports that the vote was greeted with jubilation and stomping of feet by MPs from both parties in the lower house - in a rare show of unity.
As the amendment was tabled in the lower house, the MDC's chief negotiator Tendai Biti told MPs it was a feat that the rivals had come so far.
"Everything has happened on the negotiating table other than physical confrontation. It is a miracle that we are here," AFP news agency quotes him as saying.
Correspondents say Mr Biti arrived in parliament after a morning in court relating to his treason charges. His trial was set for 4 May.
He is accused of announcing March's presidential poll result before the official electoral body, which took more than a month to make its announcement, as well as publishing false statements and insulting the president. The MDC says the results were rigged.
"We go into this government knowing that for this to work there has to be commitment," he told MPs.
"It is important to establish trust from the word go."
Last week, the MDC agreed to a new timetable proposed by the Southern African Development Community (Sadc).
The months of wrangling between Zanu-PF and MDC have centred on how the most powerful cabinet posts were to be shared out - especially that of the Home Affairs ministry which controls the police.
Negotiators are still trying to hammer out who gets what ahead of the unity government taking over on 13 February.
Another stumbling block had been attacks on and abduction of opposition and human right activists after the September deal - and Mr Tsvangirai still insists political abductees must be released.
Zimbabwe is enduring rampant inflation and an escalating food crisis.
An outbreak of cholera, fuelled by the collapse of infrastructure, has now infected nearly 66,000 people and killed more than 3,300.
Mr Tsvangirai won the first round of presidential elections last March, but pulled out of a run-off against Mr Mugabe in June, citing state-sponsored violence against his supporters.