NAIROBI, Kenya — Nairobi degenerated into violence again on Thursday, as riot police officers used tear gas, batons and water cannons to push back thousands of opposition supporters who poured into the streets to answer a call for a million-person rally that had been banned by the government.
But later in the day, Kenya’s attorney general broke ranks with the president and insisted on an independent investigation into disputed election results. It was the first clear indication of the growing divide not just on the streets but also within Kenya’s government about how to resolve a crisis that has ignited chaos and ethnic fighting across the country, killing more than 300 people in the past four days.
Starting about 10 a.m., protesters burned tires, smashed windows and clashed with the police across this capital.
Some demonstrators showed restraint, yelling to the rowdier members in their ranks, “Drop your stones!” Others tore through the slums, witnesses said, raping women and attacking people with machetes. The body of one young man who had been hacked to death lay in a muddy alley. His face was covered with plastic bags and his shoes had been stolen.
The trouble even spilled into the garden of the Serena Hotel, one of the fanciest in town. Guests in safari vests watched the turmoil from the balconies of their $400-a-night rooms. Police officers in padded suits charged a scrum of demonstrators and fired tear gas. As soon as the acrid smoke wafted up, the tourists ducked inside.
“This country is going to burn!” a protester yelled.
It has been a week since Kenyans went to the polls in the most highly contested elections in the country’s history, and the dispute over whether Mwai Kibaki, the president, honestly won the most votes continues to destabilize the nation.
The government and opposition leaders blame each other for the bloodshed, trading accusations of genocide and ethnic cleansing. They have set such strict conditions on negotiating that nothing — including the entreaties of Western ambassadors, Secretary of State Condoleezza Rice and the cries of their own people — has succeeded in getting talks started.
Kenya’s two biggest newspapers printed the identical banner headline on Thursday: “Save Our Beloved Country.”
Kenya’s attorney general, Amos Wako, said on Thursday afternoon that an independent body should investigate the disputed vote tabulations, which gave the president, at the 11th hour of the counting process, a razor-thin margin of victory. Western officials and opposition leaders have been calling for such an inquiry.
However, it is not clear if Mr. Kibaki will agree to this. A few hours after the attorney general spoke, the president reiterated at a news conference that he had won the elections fair and square and would not relinquish power.
“I will personally lead this nation in healing,” he said.
Alfred Mutua, the government’s top spokesman, said that Mr. Wako was merely making a suggestion and that an independent investigation into election irregularities “was not necessarily going to happen.”
“The president prefers the court system,” Mr. Mutua said, meaning the opposition could file a complaint in court, which most people here think is futile. But, he added, “the president has nothing to hide.”
Foreign diplomats have been meeting day and night to find a way to ease tension between Mr. Kibaki and Raila Odinga, the top opposition leader, who says he was cheated out of the presidency.
Until last week, Kenya was one of the most promising countries on the continent, but the ethnic violence, fueled by political passions, is threatening to ruin that reputation. The economy, one of the biggest in Africa, has ground to a halt. Roads are blocked. Shops are closed. Factories are idle. The currency, the Kenyan shilling, is taking a dive.
The World Bank said on Thursday that the unrest threatened Kenya’s impressive recent economic growth and poverty reduction, citing business leaders’ estimates that the country was losing some $30 million a day.
And the ills here are hurting the entire region. Gas stations in Rwanda are now rationing fuel because their supply from Kenya has been cut. In Uganda, Sudan and Congo, displaced people are running low on food because United Nations relief trucks cannot get past vigilante checkpoints. Production in places like Tanzania is slowing because materials that come from Kenya have not arrived.
“Kenya is the dynamo of this whole region,” said Harvey Rouse, a diplomat for the European Union.
Mr. Rouse spoke from a hill overlooking an enormous slum where the police were battling protesters.
The slum, named Kibera, has become the protesters’ stage. Every morning, journalists take their spots on the hillside, police officers line up at the mouth of a road leading from the shanties to the glass towers downtown and protesters mass in the streets, screaming slogans, lighting fires and burning pictures of the president. On Thursday it was an effigy stuffed with greasy rags.
Thursday was supposed to be the day that Mr. Odinga’s supporters rallied in downtown Nairobi at a place called Uhuru Park. But they never got close.
The government has banned all political rallies, and thousands of riot police officers fanned out at dawn to seal off the main routes into the city. They refused to let any demonstrators pass.
Many of the protesters seemed harmless, like the hundreds of women carrying palm leaves and walking barefoot to town. They were chased away, choking on tear gas and clawing at their eyes.
Others’ intentions were not so clear. One young protester crouched in the street with a green leaf, the sign of peace, in one hand and a rock in the other.
“We have been patient long enough!” he yelled.
It is difficult to tell which way things are going here. In the past two days, there have been no big attacks, like the one on Tuesday in which up to 50 people hiding in a church were burned alive in a village in the west. But reports from the provinces indicate the killings are still going on.