Raila Odinga has the largest party but not an overall majority
Its candidate won by just four votes after three tense rounds and following heated exchanges over ballot procedure.
The opposition, which says the presidential vote was rigged, feared the ballot for Speaker would be too.
Meanwhile, ex-UN head Kofi Annan has postponed his mediation trip for "a few days" because of flu, the UN said.
The parliament meeting was the first time opposition leader Raila Odinga and President Mwai Kibaki had been in the same room since the 27 December election. More than 600 people were killed in unrest that followed.
Celebrations
The vote for Speaker - the nation's third most powerful figure - began amid bitter clashes, with the opposition Orange Democratic Movement (ODM) calling for an open rather than secret ballot.
We hope and we expect that eventually everybody will come to their senses, realise that we've got to learn to live with each other
Martha Karua
Justice minister
Clash of generations In pictures: Angry parliament
Senior ODM official William Ruto said: "We went through [national] elections with a secret ballot, and you stole the vote."
But government MP Mutula Kilonzo retorted: "You are now violating the very principle this country has been seeking."
After one false start, MPs were called forward to cast secret ballots into a transparent box in the centre of the chamber.
The first round ended with 104 votes for ODM-backed Kenneth Marende and 99 for the government-backed Francis ole Kaparo. In the second round Mr Marende took 104 and Mr Kaparo 102.
The third round, where a simple majority was sufficient, was tense, with MPs crowding around the count to dispute possible spoilt ballots.
The ODM erupted in celebration as it was announced Mr Marende had won by 105 votes to 101.
He was immediately sworn in and said he was "humbled and deeply touched by the confidence you have actively demonstrated in me".
Analysts say the vote highlights the difficulties Mr Kibaki will have in trying to govern after his disputed win.
Security was tight for the meeting, with troops deployed around the parliament building in Nairobi.
HAVE YOUR SAY The only option for Kenya is to have a transitional government
Mohammad, Hargeisa, Somalia
Send us your comments
Opposition MPs had originally planned to sit on government benches.
But in the event, Mr Odinga took the seat reserved for the leader of the opposition.
His followers declined to stand up as Mr Kibaki entered the chamber - an indication that they do not regard his election as valid.
The ODM is the largest party in parliament, though it does not have an absolute majority.
'Cooler heads'
About 250,000 people fled or were driven from their homes after the election in a country once seen as a beacon of relative stability in East Africa.
The BBC's Adam Mynott in Nairobi says the level of violence in Kenya has fallen significantly, but tension remains very high.
Speaking ahead of parliament resuming, ODM MP Najib Balala said the party was still pressing for a new election.
Mr Annan has said he expects all sides to work hard for a solution
But he told the BBC's Network Africa programme: "We want to prove to the world we are not going to act in an uncivilised way, we are going to parliament, we are going to show that we are controlling parliament."
Justice Minister Martha Karua told the BBC she believed cooler heads would prevail.
"We are ready to navigate through a hung parliament through persuasion, through negotiations.
"We expect that eventually everybody will come to their senses, realise that we've got to learn to live with each other."
Mr Annan, the former UN secretary general, was due to arrive on Tuesday at the head of an African mediation team in an effort to bring about negotiations between Mr Kibaki and Mr Odinga.
But a UN statement said: "On his way to the airport in Geneva this morning... Kofi Annan was taken ill with a severe flu."
It said the mission to Nairobi would be postponed for "a few days".
Kenya's new Parliament convened for the first time since the country's disputed December 27 election, but politician's on opposing sides took part in a heated discussion over who would be the new speaker of the party.

Kenyan opposition politicians argued with followers of re-elected President Mwai Kibaki over how to pick a new parliamentary speaker.

When a discussion into how the speaker should be decided started, lawmakers with 's opposition  insisted the election for speaker be held by open ballot; Mr. Kibaki's supporters demanded the vote be secret.

The discussion took place  for over an hour politicians from both sides took part in a discussion where anger was clearly shown, before the two parties decided a secret ballot was acceptable.

"The standing orders are very clear that members will be given a ballot. Can you show us where it says secret ballot? We went into election with secret ballot, you stole the vote, we cannot trust you anymore," said William Ruto, a senior adviser for Odigna.

After a first round of voting, the Orange Democratic Movement candidate had a narrow lead, necessitating another ballot. If no-one gets two-thirds majority after two rounds the speaker will be elected by a simple majority in the third round.

It was an argument like that seen in Parliament that has led many Kenyans to say they have felt abandoned by their leaders in the weeks of chaos that followed the December 27 vote.

===Demonstrations===

Kenya is preparing for Wednesday, when Mr. Odinga plans the first of three consecutive days of protest in cities around the country. The government has said it will not allow the demonstrations to go ahead.

Former  secretary-general  is to go to Nairobi in a few days to try to find a solution to the issue. Mr. Kibaki's government has said it sees no reason to negotiate, because it says the vote was fair. Annan was due to arrive today but delayed it as he is suffering from flu.

===Background===

At least 500 people have been killed and more than 250,000 displaced in clashes between protesters and police, as well as ethnic-related violence that has seen rioters torch homes and businesses across the nation.

Some say they are furious over the presidential vote, which international observers have said was flawed. Others appear to be taking advantage of lawlessness that followed the vote. 

While the parliamentary debate went on, violence continued across the country. In Nairobi's giant Mathare slum, gangs torched a school and an orphanage. And to the northwest, in an area hit hard by violence, groups of young men allegedly from the Kalenjin tribe killed at least two people and set their homes ablaze.

"Gangs of Kalenjin warriors invaded the village and they burned down a couple of houses. When people went in to salvage some things, they met them and they killed two of them," said  Karanja Njoroge, a retired professor in the village where the attacks occurred.  He added that "several others were wounded with arrows in their bodies. And they removed the ones who were wounded and they ran away on the main highway toward the police station."