MAIDUGURI, Nigeria (Reuters) - The Nigerian army, backed by the country’s air force, on Monday repelled an attack an attack by Boko Haram fighters near the border with Niger in the jihadists’ northeast heartland, the military said.

The group allied to Islamic State had been fighting for at least seven years to carve out an Islamist caliphate in the region in a conflict which has displaced more than 2 million people and killed thousands.

The militants struck as the troops were on their way to the border town of Damasak where they wanted to set up a permanent base, a military source said. The army took the area back from Boko Haram last year, but has struggled to hold it.

“The Nigerian troops have successfully repelled an attack by Boko Haram terrorists who attempted an incursion into (the) 113 Battalion,” army spokesman Sani Usman said in a statement carried by PR Nigeria, which releases government statements.

Kareto is the army’s next base in the area.

“So far our troops had two officers and 22 soldiers wounded in action,” he said without giving further details.

No further information was immediately available from the remote area which is largely disconnected from mobile phone networks.

Boko Haram controlled a swath of land in northeast Nigeria around the size of Belgium at the start of last year, but was pushed out by Nigerian troops, aided by soldiers from neighboring countries.

The group has since stepped up cross-border attacks and suicide bombings against markets, bus stations and places of worship.