The Constitution of Kenya (Amendment) Bill was passed by a unanimous 200-0 majority in a session broadcast live on television.
The bill creates the positions of a prime minister and two deputies in the cabinet; it needed a two-thirds majority.
The next step is to pass another Bill creating these posts in a new unity government.
Both bills will still require presidential assent before it becomes law.
In a speech to legislators on Thursday, Mwai Kibaki, the country's president, urged them to set aside partisanship and enshrine into law a pact to end the post-election crisis.
Kibaki, who will remain president, gave the speech as he chaired a meeting of the Grand Coalition Joint Parliamentary Group before officially opening the parliament session.
"I urge all honourable members to support the proposed legislative measures which will go a long way in ensuring peace and stability in our country," he said.
"I also appeal to you all, to be guided by a strong sense of national unity, which must override all partisan considerations."
The agreement between Kibaki and Odinga was reached after weeks of mediation by Kofi Annan, the former UN secretary-general.
Both sides have agreed to set up a committee that will outline policies for the coalition government to be formed in the near future.
The newly formed cabinet coalition will replace the previous government announced by Kibaki, days after he was controversially declared the winner of the presidential polls.
Last month's accord had been well received in Kenya but tough negotiations lie ahead for both sides as the government line-up remains yet to be decided.