NIAMEY (Reuters) - Boko Haram retook the town of Bosso in southeastern Niger on Sunday night after clashes with soldiers from Niger and Nigeria, the mayor of Bosso and a military source said on Monday, although the Nigerien government said it had control of the area.

The Islamist group first took the town near the Nigerian border on Friday in an attack in which 30 soldiers from Niger and two from Nigeria were killed.

It was the deadliest assault in Niger by the Islamist group since April 2015, when at least 74 people, including 28 civilians, were killed at the Lake Chad island of Karamga.

Nigerien troops retook Bosso by Saturday morning, the defense ministry said. But Bosso Mayor Mamadou Bako said they lost control again on Sunday night and that the town remained under Boko Haram’s control. A military source in Diffa, about 100 km (60 miles) west of Bosso, confirmed the takeover.

The Nigerien government denied that Boko Haram had taken over Bosso, and said in a statement that the town was “completely under control” on Monday evening.

Reuters was unable to independently verify who had control of the town.

Bosso is part of the Diffa region near Lake Chad, where Cameroon, Chad, Nigeria and Niger meet and where many refugees have sought shelter from Boko Haram violence over the years.

More than 30 attacks have been attributed to the militants in the region this year, the United Nations says. The U.N. humanitarian agency said in a statement on Saturday that civilians were reported to be fleeing the area.

Boko Haram has been trying to establish an Islamic state adhering to strict Sharia law in northeast Nigeria since 2009. About 2.1 million people have been displaced and thousands have been killed during the seven-year insurgency.

Along with Chad, Cameroon, Nigeria and Benin, Niger has contributed troops to a 9,000-strong regional task force dedicated to fighting the group.