Mugabe will remain the head of state and Zanu-PF and the MDC will share the cabinet posts.
"It has been a long, frustrating, quarrelsome journey characterised by animosity and name-calling, but notwithstanding this, what is important is we have reached this path," Patrick Chinamasa, Mugabe's lead negotiator, said.
Tendai Biti, MDC's secretary-general, said the new unity government should give hope to Zimbabwe.
"We have no choice other than to give this experiment a try," he said.
After passing the parliament, the senate also approved the bill. Mugabe is to sign it into law.
Both parties agreed on September 15 to form a government but until last week, they were not able to agree on the division of cabinet posts and control of security forces.
In elections in March last year, the MDC seized a parliamentary majority for the first time and Tsvangirai defeated Mugabe in a first-round presidential vote.
The result sparked a wave of political violence, which Amnesty International said left more than 180 dead and targeted mainly MDC supporters.
Tsvangirai boycotted the final run-off and Mugabe declared a one-sided victory.
Zimbabwe's economy is in deep crisis, with half the population in need of food aid.
Official inflation, last recorded in mid-2008, had soared to 231 million per cent. The United Nations says unemployment is 94 per cent.
More than 65,000 people are infected with cholera and 3,323 have died since the epidemic broke out in August.