GENEVA (Reuters) - An estimated 30,000 Nigerians have returned since Tuesday from Cameroon to the flashpoint town of Rann, which has been targeted repeatedly by Boko Haram militants this year, the U.N. refugee agency said in an emailed comment to Reuters on Thursday.

The men, women and children were among 40,000 civilians who fled Rann and sought refuge in the Cameroonian village of Goura.

A United Nations humanitarian report said 5,000 remained in Goura and were expected to make the 8-km (5-mile) trip to Rann on foot on Friday.

The other 5,000 had reportedly traveled to Maiduguri, the capital of Nigeria’s Borno state, or to other unknown locations, the U.N. report said.

The Rann residents who decided to return did so after being visited by Nigerian officials who encouraged them to go, and gave assurances that security would be restored in the area, the UNHCR statement said.

“They have responded to this appeal and many have opted to take the return journey home,” UNHCR said.

“We have also advocated with the authorities to guarantee admission and protection of those seeking asylum and government support so that humanitarian organizations can deliver assistance.”

On Wednesday, the aid agency Medecins Sans Frontieres (MSF) said Cameroonian and Nigerian authorities had ordered the 40,000 refugees to return to northeast Nigeria.

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.

UNHCR has previously criticized Cameroon for refusing to accept refugees from Rann, in breach of its international obligations, but UNHCR officials met Cameroonian authorities on Wednesday and received assurances that refugees would not be forced to return, it said.