MI6 agents have warned the Government that Islamic State militants based across the Middle East are planning a series of attacks.
Their warning comes after 30 UK citizens were among 38 people killed in a terrorist gun attack on a beach in Tunisia in June.
Bomb experts, intelligence officers and a ground protection squad will be based in Morocco for several weeks, defence sources said.
The British troops will help train the Moroccan armed forces in bomb disposal and coping with mass casualty incidents.
The soldiers could also be used to deal with any hi-tech bombs planted by militants.
The next big surge of UK tourists into Morocco will be during the school half-term break later this month.
Many tourists have been attracted by the offer of cheap full-board package deals by holiday companies.
But the British and Moroccan intelligence services have recently uncovered several terror plots by members of Islamic State and al-Qaida.
Defence sources revealed there is a “high threat” of an attack using improvised explosive devices against Brit holidaymakers.
After the threat level in the country was raised last month, the UK offered help.
A team of bomb disposal troops will now fly out to Casablanca in the next few days.
A defence source said: “The British Army probably has the best trained and most experienced bomb disposal experts in the world.
“Their knowledge is based on the conflict in Northern Ireland and the wars in Iraq and Afghanistan, so they are well placed to deal with any type of home-made bomb.
“Morocco has very few bomb disposal officers. We offered our help and they were very grateful.
“The plan is for our troops to help deal with any emergencies that may arise over the next few weeks. They will also help train and mentor their Moroccan colleagues.”
Ten suspected Isis members were arrested in joint operations in Morocco and Spain last week.
Advice on the Foreign Office website says there is a high threat of terrorism in Morocco and adds attacks could be indiscriminate and target places visited by foreigners.
The site especially warns British tourists to be vigilant at all times.
It adds “Protective security measures are in place at many Moroccan hotels and sites popular with tourists.
“Security measures, including security personnel, may be visible in certain areas.
“The Moroccan authorities have warned of an increased threat linked to the growing number of Moroccans sympathetic or belonging to international terrorist organisations operating in Syria, Iraq and Libya, and regularly report the disruption of terrorist cells.
In April 2011, a total of 17 people were killed and 25 injured in an explosion at a popular restaurant in Marrakech.
Earlier this year Morocco was ranked by TripAdvisor users as Britons’ favourite holiday destination.