The U.N. chief has warned that Ivory Coast faces “a real risk” of return to civil war, and that U.N. peacekeepers will face a critical situation in the coming days unless Laurent Gbagbo removes a blockade around his opponent’s headquarters.

The United Nations and other world leaders recognize Alassane Ouattara as the winner of last month’s disputed presidential election. Mr. Gbagbo, the incumbent who refuses to acknowledge defeat and leave the presidency, has forces surrounding the building where his rival is based.

The U.N. has said that people inside are not getting needed medication, and that delivery of food and water also has been hampered.

“Any attempt to starve the United Nations mission into submission will not be tolerated,” U.N. Secretary-General Ban Ki-moon said on Tuesday.

Mr. Gbagbo ordered U.N. peacekeepers out of the volatile West African country over the weekend but the U.N. refused, instead extending the mission’s mandate through June. Hundreds of U.N. peacekeepers are guarding the Golf Hotel, where Mr. Ouattara is based.

In a speech late Tuesday, Mr. Gbagbo said “the international community has declared war on Ivory Coast.”

“I call on those who are still in the Golf Hotel to go home,” Mr. Gbagbo said. “No one will prevent you from leaving.”

Fears have risen that U.N. personnel and other foreigners could be targeted in violence as tensions mount over the election. Over the weekend, masked gunmen opened fire on the U.N. base in Ivory Coast, though no one from the global body was harmed in the attack. Two military observers were wounded in another attack. The U.N. also says armed men have been intimidating U.N. staff at their private homes.

Toussaint Alain, an adviser for Mr. Gbagbo, said he didn’t believe soldiers or people close to Mr. Gbagbo would carry out such acts.

The U.N. secretary-general also said on Tuesday that the U.N. peacekeeping force in Ivory Coast has “confirmed that mercenaries, including freelance former combatants from Liberia, have been recruited to target certain groups in the population.”

Ivory Coast’s 2002-2003 civil war saw the involvement of Liberians fighting on nearly all sides of the conflict. Liberia itself suffered back-to-back civil wars that lasted until 2003, and the two countries share a porous, 370-mile (600-kilometer) long border.

Liberia’s president has urged citizens not to get involved in Ivory Coast’s latest political crisis.

Mr. Ban also said forces loyal to Mr. Gbagbo are also obstructing the movement of U.N. personnel and their operations and called on member states to do what they can to supply the U.N. mission.

The U.N. says more than 50 people have been killed in recent days in Ivory Coast, and that it has received hundreds of reports of people being abducted from their homes at night by armed assailants in military uniforms. U.N. High Commissioner for Human Rights Navi Pillay has cited growing evidence of “massive violations of human rights.”

Amnesty International on Tuesday said that it has also received reports from eyewitnesses of people being arrested or abducted, both at home and on the streets, by security forces loyal to Mr. Gbagbo. In a report, the group said that bodies have been found in morgues and on the streets, and that violence and intimidation has not been confined to Abidjan.

“It is clear that more and more people are being illegally detained by security forces or armed militiamen and we fear that many of them may have been killed or have disappeared,” said Salvatore Sagues, Amnesty International’s West Africa researcher.

Ivory Coast was once an economic hub because of its role as the world’s top cocoa producer. The 2002-2003 civil war split the country into a rebel-controlled north and a loyalist south. While the country officially reunited in a 2007 peace deal, Mr. Ouattara still draws his support from the northern half of the country where he was born while Mr. Gbagbo’s power base is in the south.

Mr. Gbagbo claimed victory in the presidential election only after his allies threw out half a million ballots from Ouattara strongholds in the north, a move that infuriated residents there who have long felt they are treated as foreigners in their own country by southerners.

More In: International | News