Canadian special-forces soldiers providing counterterrorism training in Niger have been forced to pack up from a border region and relocate to another part of the African country in order to stay out of the way of fighting between Boko Haram extremists and government troops.

At the same time, the Canadian military says it stands ready to step up its role in Niger if Ottawa decides to send aid. The government of Niger, a poor desert country, recently declared a state of emergency in the border region of Diffa after a number of attacks by Boko Haram, an Islamist terror group.

Troops from Canada are training African counterparts in shooting, communications and mission planning – skills they could use in order to combat groups such as Boko Haram, which controls more than 50,000 square kilometres of territory in western Africa and is destabilizing the region.

Story continues below advertisement

The operations are being conducted as part of an annual U.S.-sponsored military exercise called Flintlock, which this year began in February and runs until March 9.

Canadian special-forces soldiers were in Diffa as part of the operations but Boko Haram has repeatedly struck the border region in recent weeks, reportedly raiding a local prison, launching mortar shells and setting off bombs. They have repeatedly clashed with Niger forces.

The Canadian Armed Forces says the multinational training exercises planned for Diffa were relocated elsewhere in the country to avoid being disrupted by the conflict.

"This was seen as a prudent measure given the current security situation [and] in order to allow participants from every nation to concentrate on getting as much out of Exercise Flintlock 15 training as possible," military spokesman Daniel Le Bouthillier said.

The Forces won't say how many Canadian soldiers are in Niger, citing security concerns, but it's believed to be a small number.

Moving the special-forces soldiers ensures they won't find themselves drawn into a fight with the enemy as Canadians have been recently in northern Iraq. On a number of occasions in recent months, Canadian troops helping train Kurdish fighters battling Islamic State militants have come under fire and shot back in self defence.

The military is emphatic that Canada's special-forces troops did not come under fire from Boko Haram and did not engage the militants.

Story continues below advertisement

Canadian Special Operations "personnel are not involved in combat operations in Niger or the surrounding region," Mr. Le Bouthillier said. None have been injured, he said.

"The government of Canada takes the situation with Boko Haram very seriously … the safety of our personnel is a top priority. All [Canadian Special Operations Command] members are safe and well-situated in a secure environment."

Canada's military said special forces is prepared to shift tasks and help the Niger government cope with the impact of Boko Haram attacks if Ottawa decides to do so.

"We will remain responsive to the situation and support any Government of Canada decision regarding humanitarian assistance or any other required assistance," Mr. Le Bouthillier said.

Niger, Nigeria, Chad, Benin and Cameroon are part of a regional alliance fighting Boko Haram, which wants to overthrow the secular government of Nigeria and enact a strict version of sharia law.