Rebel forces in Ivory Coast have taken control of the official capital, as power seems to be slipping away from the president, Laurent Gbagbo.

Residents and military sources said troops loyal to Gbagbo's rival, Alassane Ouattara, had entered Yamoussoukro, meeting little resistance as security forces fled. The port city of San Pedro also fell.

Yamoussoukro residents told how they braced themselves for conflict before sporadic gunfire erupted. Serge Kipre, who runs a small clothing store in the city, said: "The night before, we were all calling each other to make sure nobody went outside. In the morning, I saw loads of police with balaclavas and Kalashnikovs racing across town. The market closed, shops shuttered. Everybody seemed on edge."

But the approach of the rebels was eagerly awaited by many young pro-Ouattara supporters. Kipre added: "They set a police station ablaze because they felt they would be liberated soon. We are so tired of this situation – we just want them to get it over with."

The pro-Ouattara Republican Forces (FRCI) captured the city within hours as government opposition melted away. Eyewitnesses saw soldiers taking off their uniforms and throwing guns and ammunition into ditches as they fled from the rebel army. Others say some soldiers simply switched sides and joined the FRCI.

The capture of Yamassoukro, which is in a pro-Ouattara area, is symbolic but not decisive. Gbagbo's seat of power is in the commercial capital, Abidjan, where fighting has raged for months. But the fall of Yamoussoukro opens up the main road to Abidjan, just 143 miles away.

Earlier this month a leader of rebel forces, which have controlled northern Ivory Coast since the 2002-03 civil war, told the Guardian they would "surprise all the analysts" by removing Gbagbo quickly and cleanly.

Such confidence appears to have been borne out so far as the rebels make rapid advances on three fronts and encounter little resistance.

Gbagbo has called for a ceasefire, though this has been widely dismissed as a ploy. Young men are being enrolled into the army, reportedly to replace soldiers who are not turning up for work or who have changed sides.

Ally Coulibaly, Ouattara's ambassador to Paris, claimed rebel forces now controlled three-quarters of the country. "President Alassane Ouattara was patient and gave Mr Laurent Gbagbo every possibility to leave power peacefully," he told the French radio station France Inter. "He refused every offer made to him."

Ivorians had eventually had to take up arms to avoid a massacre of the civilian population, he added.

A statement by Ouattara's RHDP party said: "All peaceful avenues to convince Laurent Gbagbo of his defeat have been exhausted."

Forces loyal to Ouattara have taken several western towns with relative ease, but Abidjan poses a tougher challenge. Don Mello, a spokesman for Gbagbo, told Radio France International it was "impregnable" to attack.

"We call for an immediate ceasefire and the opening of talks under the mediation of the African Union high representative," he said. "Failing which, we will use our legitimate right of defence.

"We have adopted a strategy of tactical withdrawal. We hope that dialogue will open very shortly. It is useless to head into conflict and increase the number of victims."

A priest in Tiebissou, who did not wish to be named, said Gbagbo's forces had tried to fight off the rebels for three and a half hours before fleeing.

Another priest said he had seen the bodies of three dead soldiers in the town, which is 21 miles from the capital. Many wounded fighters were being taken to a nearby hospital. People were looting public buildings in Tiebissou, including the police station, witnesses said.

A third front from the east of the country was advancing south, with combat taking place in Akoupe. The rebels secured Bondoukou and Abengourou, along the Ghana border on Tuesday, and seemed poised to strike directly at Gbagbo on this front, as Akoupe is only 70 miles from Abidjan.

Violence in Abidjan may escalate after Gbagbo's army spokesman called on his youths to join the fight. "The hour for their enrolment has arrived," Colonel Babri Gohourou told state TV. "They will be called up from Wednesday."

In several neighbourhoods of Abidjan, men in military uniform continued to threaten and extort immigrants and Ivorians with northern names.

Malick Traore, a doctor whose parents were born in neighbouring Mali, was stopped by six gunmen and asked to show his identity papers.

He said: "They said: 'Oh, you are against us; you are against the republic. We'll give you a choice: either we kill you on the spot or we send you to the frontline.' Luckily, I had money on me, and I gave them everything I had. So they let me go.

"A little while later, I heard poom-poom-poom – you know, the sound of an automatic gun. They killed five people on the spot, including a coffee seller who was very well liked in our neighbourhood."

Gbagbo's Young Patriots have targeted UN staff for weeks, beating them, burning UN vehicles and sometimes abducting them.

A Nigerien UN peacekeeper was seized by unknown attackers two weeks ago and remains missing, according to security sources. "We think one of our soldiers in the Nigerien contingent in Abidjan was kidnapped in the week from 12 to 19 March," a security source in Niamey, Niger's capital, told Reuters. "The UN is investigating."

The international community and Ivory Coast's electoral commission say Ouattara won the presidential election. But Gbagbo refuses to give up power.

More than 1 million people have fled the fighting that has ensued and at least 462 have been killed since the election, according to UN figures. Ouattara's camp puts the death toll above 700.