Madrid: The mastermind of the 9/11 terror attacks and one of the most dangerous terrorists in the world was sheltered by the government of Qatar for years.

And US security officials, who knew of Khalid Shaikh Mohammad’s involvement in plotting a large-scale truck bombing of the World Trade Centre in 1993 and in another terrorist atrocity in Manila, found him working at the Water Department in Qatar in a plum job.

More revelations of Qatar’s plots in Libya

Crisis: Qatar fails to grasp the reality

Qatar’s shrinking options from its rigid stance

But Mohammad couldn’t be arrested because US security officials could not trust the Qataris and their security services to do the job for them.

This startling new claim lends more credence to claims that Doha aids and abets terrorists.

The governments of the UAE, Saudi Arabia, Bahrain and Egypt have shut their airspace and territorial waters to craft from Qatar for the past month, trying to pressure the Doha government to stop funding extremist groups and individuals who endorse terrorism. They want Qatar to live up to its international obligations and treaties to stop supporting extremism.

As it turns out, Mohammad was tipped off, hid in Doha and slipped out of the Gulf state just hours after the US ambassador told the Qatari Emir of the wanted terrorist in their midst.

Now, Mohammad sits in a jail cell in Guantanamo Bay, awaiting a military court to judge him on his role in plotting the mass terror attacks on New York and Washington on 9/11. But it took years of hunting for the Pakistani national after the world’s deadliest terror attacks for him to be held.

If the Qataris were to be trusted in 1996, would Mohammad have been able to plot the 9/11 attacks? That’s a lingering question that haunts Richard A. Clarke, a top security official in the White House administration of President Bill Clinton. Clarke chaired at inter-agency Counter-terrorism Security Group in Washington, liaising for the National Security Agency, the Central Intelligence Agency, other US security interests and the White House.

“By 1996, because of the New York and Manila plots, we considered (Khalid Shaikh Mohammad) the most dangerous individual terrorist at large,” Clarke says in an op-ed piece published in the New York Daily News. “Later that year there was a sealed federal criminal indictment for KSM. US intelligence was trying to locate him as a matter of priority,” he says.

The US agents did eventually track Mohammad down.

“They found him in Qatar, where he has been given a patronage job in the Water Department,” Clarke says, adding that his security group pondered their next move.

“There was a consensus in the group that we could not trust the Qatar government sufficiently for us to do what otherwise would have been obvious: ask the local security service to arrest him and hand him over,” Clarke says.

But he goes further, bolstering the claims by the UAE and its allies that Qatar funds and supports terrorism.

“The Qataris had a history of terrorist sympathies and one cabinet member in particular, a member of the royal family, seemed to have ties to groups like Al Qaida and appeared to have sponsored KSM,” Clarke alleges.

He says the Qataris have been sheltering terrorists for more than two decades.

But because Mohammad was being sheltered on Qatari soil, there were few options for arresting him. One like snatching him off the street and rendition back to the states were fraught with logistical, legal and diplomatic issues.

“The Clinton administration was left with only one option: approaching the Qataris,” Clarke says. “To mitigate the risk inherent in the move, the US ambassador was asked to only talk to the Emir. He would ask the Emir to talk only to head of the Qatari security service. The request was that they should grab KSM and hold him for a few hours so that we could land an arrest team to fly him to the US.”

But the Qataris were not to be trusted, and for the US to place their faith in the plan proved to be a mistake.

“Within hours of the US ambassador’s meeting with the Emir, KSM had gone to ground,” Clarke says.

“In tiny Doha, no one was able to find him,” he says.

Later, the Qataris told the Americans that Mohammad was able to leave the country.

“They never told us how,” Clarke says.

But Mohammad did resurface again.

As well as plotting the 9/11 attacks, he went on to mastermind the bloody Bali bombings, the beheading murder of Washington Post reporter Daniel Pearl in Pakistan, and other bloody terrorist incidents.

But to this day, Clarke is haunted by one prevailing thought: “Had the Qataris handed him over to us as requested in 1996, the world might have been a very different place.”