GENEVA (Reuters) - At least 10,000 Nigerians returned to a flashpoint town on Wednesday after fleeing into Cameroon to escape repeated attacks over the past few months, a U.N. humanitarian report said.

The returnees were among 40,386 civilians who had fled four attacks on the town of Rann since December, the report bit.ly/2H2aj3T said.

All those who fled were ordered to return to northeast Nigeria, the aid agency Medecins Sans Frontieres said earlier in the day.

“Reports from sources on the ground indicate that hundreds more are en route to Rann from Cameroon (8 km) by foot,” the U.N. report said. “All these people are in dire need of humanitarian assistance, including shelter, food and safe water.”

Earlier this month the militant group Boko Haram killed at least 60 people in Rann after it was abandoned by the military, Amnesty International and security sources said.

That attack came two weeks after Boko Haram overran the town, driving out Nigerian soldiers and signaling the group’s re-emergence as a force capable of capturing army bases.

Last month Cameroon was criticized by the U.N. refugee agency for sending 9,000 people back to Rann and refusing them asylum, breaching the international principle of “non-refoulement” of refugees.

The U.N. humanitarian report referred to Rann residents who had sought sanctuary in Cameroon as “internally displaced people” rather than “refugees”, despite the fact that they had crossed an international border.

It said humanitarian aid workers had not been able to return to Rann since Jan. 17. On March 1 last year, three aid workers were kidnapped from Rann, and two were subsequently executed.

The return to Rann came on the day when Nigeria’s President Muhammadu Buhari was declared to have comfortably won a second term, but his main rival planned a fraud challenge after a vote marred by delays and violence.

Buhari had promised to improve security, having made a similar promise in his first presidential election campaign in 2015.