The lawmakers — who include 21 women, a record here — now begin the delicate business of carrying out the much-anticipated and possibly awkward power-sharing deal. Under it, the top opposition leader, Raila Odinga, becomes prime minister, and the governing party and the opposition divide the cabinet posts.
This was the deal to bring peace back to Kenya, which had been considered one of the most stable countries in Africa before the violence of recent months.
On Thursday, Mr. Kibaki urged Parliament to swiftly pass the legislation needed to turn the political agreement into law. Lawmakers on both sides have predicted more skirmishes over the next few weeks as they negotiate how much power Mr. Odinga actually gets and how cabinet positions are reassigned.
Mr. Kibaki said that once the new government was solidified, it would dive into an ambitious agenda that would include helping the fishing and tourism industries and building better housing for the millions of Kenyans who live in shanties.
“We still have many challenges, but we still have a lot to celebrate,” Mr. Kibaki said.
His speech seemed to be a pep talk for a country that sorely needed one. Kenya erupted into violence in late December after the national election commission declared Mr. Kibaki, the incumbent, the winner of a closely contested presidential race over Mr. Odinga, who claims to have won the most votes. Election observers have been unanimous that the results were tainted, with some saying that the government rigged the tallying of votes to give Mr. Kibaki a slender 11th-hour edge.
The controversy set off fighting across the country between supporters of Mr. Odinga and those of Mr. Kibaki, who are from different ethnic groups, and it stirred up long-festering political, ethnic and economic grievances. More than 1,000 people were killed, and hundreds of thousands fled ethnically mixed areas, creating a degree of ethnic segregation that had never existed in this country before. The violence has greatly diminished in the past few weeks, but the tension and displacements have continued.
Mr. Kibaki, who has been in Parliament since Kenya’s independence in 1963, said the government would set up a truth and reconciliation commission and address head-on the country’s painful ethnic issues. He also promised to pay for new homes for displaced people and to distribute free seeds to displaced farmers.
Mr. Odinga sat quietly throughout the speech. His party holds a slight edge in Parliament, which has 210 elected members and 12 appointed seats, though two of his colleagues were killed after the election, narrowing the opposition’s majority. Despite all the talk of a new coalition government, Mr. Odinga and his top lieutenants sat on the opposition side of the chamber on Thursday, across the room from Mr. Kibaki’s political allies, who occupied the government seats. There was mingling, though, among some freshmen lawmakers from the different parties.
Kenneth Marende, the Parliament speaker and a member of Mr. Odinga’s party, said, “The recent events have exposed the fault lines in our system of governance.”
“If Parliament descends into anarchy,” Mr. Marende added, “the Kenyan nation will not just sink, it will drown.”

