A NATO AWACS (Airborne Warning and Control Systems) aircraft is seen on the tarmac as it prepares to take-off for a training mission from the AWACS air base in Geilenkirchen near the German-Dutch border April 16, 2014. REUTERS/Francois Lenoir/Files

By Robin Emmott

BRUSSELS (Reuters) - NATO and its allies will hold their biggest military exercise in more than a decade from October, deploying 36,000 personnel across the Mediterranean to counter the threat of Islamic State on the alliance's southern flank.

Briefly turning attention away from Russia, NATO commanders said on Wednesday the alliance would carry out some of its toughest training yet in a complex "artificial threat scenario" in which militants attack on land, from the air and at sea.

"We cannot choose between the eastern threat and the southern threat, we have to train for both," said General Hans-Lothar Domrose, commander of the NATO military command in Brunssum, the Netherlands, who is preparing the exercise.

After more than a decade of NATO-led combat operations in Afghanistan, the U.S.-led military alliance is shifting to defend its territory.

More than 30 countries - including non-NATO nations such as Sweden and Austria - will take part in the exercises in Italy, Spain, Portugal and in the Mediterranean from Oct. 3 to Nov. 6.

Much of NATO's focus has been on what it sees as an increasingly hostile Russia, but the rise of Islamic State in Iraq and Syria is a central concern. NATO Secretary-General Jens Stoltenberg has warned the Arab Spring uprisings have ushered in a "brutal winter" of instability.

NATO has not held exercises on this scale since 2002, when 15 members of the alliance and 12 partner nations tested their capabilities in Norway and Poland.

Asked what had changed since then, Domrose said NATO had to grapple with enemies spreading propaganda via social media able to inspire attacks in North America and Europe, as well confronting militant groups across wide areas.

"Distance is a new factor. We will be working in a huge training area," Domrose said. "We will focus on speed, on multiple threats, simultaneously."

The exercises are part of NATO's commitment to a new "spearhead" rapid reaction force including several thousand soldiers who could be sent to a hotspot in just two days.

Given the migration crisis in the Mediterranean, with thousands of people fleeing war and poverty in Syria and North Africa to try to reach Europe, NATO commanders also promised to react if migrant boats were spotted near their exercises.

"If there is a crisis in the vicinity of one of our ships ... we will stop the exercise and give humanitarian help," Domrose said. "We will not let people die."

(Reporting by Robin Emmott; Editing by Ros Russell)