Between 2,000 and 3,000 nationalist Young Patriots made two attempts to break into the UN premises in the commercial capital, where they were driven off with tear gas and warning shots fired in the air, like the previous day.
Mr Gbagbo and Prime Minister Charles Konan Banny have called on their supporters to end the street violence and go back to work.
Following emergency talks with Nigerian President Olusegun Obasanjo, the Ivorian leaders called on the people "to withdraw from the streets and to go back home."
The President of the Republic of Ivory Coast and the Prime Minister invite the people... to go back to work tomorrow, the 19th of January," in a joint statement.
The statement added that Mr Gbagbo and Mr Konan Banny had been "invited" to continue with talks aimed at reaching a political solution to the crisis "in the coming days".
It was the first time that the two Ivorian leaders had made such a statement since the crisis began on Monday.
Earlier a spokeswoman for Mr Obasanjo, the chairman of the African Union, said he had had several hours of meetings in Abidjan with Mr Gbagbo and Prime Minister Konan Banny in a bid to resolve the current impasse in the country.
"Also in attendance at the meeting at the invitation of President Gbagbo was the special representative of the UN Secretary General, Pierre Schori, and Ralph Uwechue, representative of the executive secretary of ECOWAS (Economic Community of West African States)," said the spokesman.
City life halted
The militants, who have halted city life for three days with angry protests at an international move to scrap the Ivorian parliament, used petrol bombs and managed to set fire to the big entrance to the compound on open ground at the end of a street, blackening the familiar pale-blue UN paintwork.
Demonstrators ripped down the barbed wire round the UN base, one made a hole in the concrete wall with a hammer and a group of self-named "Kamikazes" with black-daubed faces sang their national anthem and threw petrol bombs, one landing on the roof of a UN building.
French peacekeeping troops were brought in by helicopter but fired no shots, a French military spokesman said.
In the west, a border region notorious for unrest, Bangladeshi UN troops battled youths who attacked military camps at Guiglo and Duekoue.
UN, Ivorian and French military sources told how the assailants tried to occupy the bases, clambered on armoured vehicles and the soldiers opened fire, killing four and wounding 12.
The 500 Bangladeshi troops in the two UN contingents there then evacuated to the demilitarised "confidence zone", which crosses Ivory Coast between rebels in the north and the government south, under escort of the Ivorian national army, a French military source said.
Ivory Coast's New Forces rebel group on Wednesday called for an immediate halt to demonstrations.
Halt violence
The head of the armed wing of the New Forces, "General" Soumaila Bakayoko, said in a statement that the demonstrations were a "manoeuvre to destabilise the transition government" that "would not be accepted".
Mr Bakayoko called for an "immediate halt to this useless and absurd violence" and criticised the loyalist defence and security forces for failing to re-establish public order.
Hundreds of so-called Young Patriots have manned barricades across Abidjan since Monday and tried to storm UN headquarters in the economic capital, after a UN-backed mediation group called for the Gbagbo-majority parliament to be dissolved.
The move was seen as aimed at easing the way for the UN-backed transitional government of Konan Banny, tasked with disarming the northern rebels, reconciling the warring sides and holding elections by October.
Mr Gbagbo's supporters branded it "an attack on national sovereignty" and his party, the Ivorian Popular Front (FPI) announced Tuesday it was pulling out of the transitional government and the peace process.
Tough response considered
Rebels of the New Forces have controlled the north of the country since a failed coup against Gbagbo in September 2002.
In New York, the UN Security Council considered a tough response including sanctions against individuals trying to thwart the peace process.
Augustine Mahiga of Tanzania, the council president for January, said there was "great concern" among members and a panel of experts was putting the final touch on a presidential statement expected to be adopted Thursday.
France, the former colonial power in Ivory Coast, hopes the unrest can be calmed through negotiations, French Prime Minister Dominique de Villepin said in Berlin.
"We hope that, through all the means of dialogue at our disposal, that with President Gbagbo and the government of Charles Konan Banny and with all those who share responsibility for Ivory Coast, we can return to the path of dialogue," Mr Villepin said during a visit to the German capital.
