Fighting between armed groups and the army in northwest Nigeria has forced international aid group Medecins sans Frontieres (MSF) to evacuate some of its staff in the area, the agency said on Friday.

The move illustrates the difficulty humanitarian groups face in Nigeria's northwest, where militias known locally as bandits attack communities, loot villages and carry out mass kidnappings for ransom.

The MSF said an escalation of violence in Zamfara state prompted the agency to withdraw part of its staff from Zurmi town, where clashes occurred around the local hospital.

"Faced with important security risks, MSF medical teams on the ground had to evacuate part of its staff and are unable to function optimally," the statement said.

A spokesman said six non-essential international staff were evacuated while other international and national foreign staff remained.

Zamfara State officials and police did not respond to calls seeking details.

But local governor Dauda Lawal said on social media he was concerned about recent bandit attacks in the Zurmi, Maru, and Tsafe districts of Zamfara.

Nigerian newspapers and television channels reported clashes in Zurmi district after an armed militia attacked the local government headquarters and troops responded.

"Some of the patients refuse to leave the hospital out of fear," Adjide Hermann, MSF deputy field coordinator in Zurmi, said in the statement.

"We had no choice but to reduce part of our team."

Zamfara is one of several northwestern states struggling with banditry. The crisis has its roots in clashes over land between nomadic herders and pastoral farmers, but has spiralled into broader violence.

Many international aid groups operate in northeast Nigeria, where a 14-year-long jihadist conflict has displaced more than 2 million people since 2009.

Islamist militants have been driven out of swathes of territory they once controlled at the height of the conflict, though they still carry out attacks in rural areas.

Violence in northwest and northcentral Nigeria has also displaced around one million people, according to the UN's IOM migration agency, but aid groups are less present in that region.