Islamic State militants have accepted a pledge of allegiance by the Nigerian-grown Boko Haram extremist group, a spokesman for IS said.

The development comes as both terror groups, which are among the most ruthless in the world, are under increasing military pressure and have suffered setbacks on the battlefield.

IS seized much of northern and western Iraq last summer, gaining control of about a third of both Iraq and Syria. But it is now struggling against Iraqi forces seeking to recapture Saddam Hussein's hometown of Tikrit, while coming under fire from US-led coalition air strikes in other parts of the country and in Syria.

Boko Haram, meanwhile, has been weakened by a multinational force that has dislodged it from a score of north-eastern Nigerian towns. But its new Twitter account, increasingly slick and more frequent video messages, and a new media arm were all considered signs that the group is now being helped by IS propagandists.

On Saturday, Boko Haram leader Abubakar Shekau posted an audio recording online which pledged allegiance to IS.

Now IS's media arm, Al-Furqan, in an audio recording by spokesman Abu Mohammed al-Adnani, said Boko Haram's pledge of allegiance has been accepted, claiming the caliphate has now expanded to West Africa.

Al-Adnani had urged foreign fighters from around the world to migrate and join Boko Haram.

"We announce our allegiance to the Caliph of the Muslims ... and will hear and obey in times of difficulty and prosperity, in hardship and ease, and to endure being discriminated against, and not to dispute about rule with those in power, except in case of evident infidelity regarding that which there is a proof from Allah," said the message.

J Peter Pham, director of the Africa Centre at the Atlantic Council, a think-tank in Washington, noted IS's quick acceptance of Boko Haram's allegiance and said the bond highlights a new risk.

"Militants finding it increasingly harder to get to Syria and Iraq may choose instead to go to north-eastern Nigeria and internationalise that conflict," he said.

In the past - as was the case with IS affiliates in Egypt, Yemen and Libya - it took weeks for IS to respond to a pledge of allegiance.

"The prompt - one might even say 'fast-tracked' - acceptance by the so-called Islamic State of Boko Haram's pledge of allegiance" underscores that both needed the propaganda boost from the affiliation, Mr Pham added.

Boko Haram's pledge comes as the militants were reported to be massing in the north-eastern Nigerian town of Gwoza, considered their headquarters, for a showdown with the Chadian-led multinational force.

Boko Haram killed an estimated 10,000 people last year, and has been blamed for last April's abduction of more than 275 schoolgirls. Thousands of Nigerians have fled to neighbouring Chad.