Qatar has joined the American-led coalition to fight Islamic State, yet the emirate is a haven for anti-Western groups and foreign diplomats have reported seeing cars with Islamic State logos in an affluent bay district.
Such ambiguity runs through Qatari policy.
When the United States sought allies against Islamic State in Sept, Qatar was among the Gulf Arab states that sent its warplanes into action. But while Saudi Arabia and the United Arab Emirates welcomed media coverage, Qatar was silent.
There was talk among diplomats that Qatari planes merely flew a reconnaissance mission on the first night of the attacks.
In fact, a security source close to the government said, its planes did attack Islamic State targets in Syria later in the campaign, although that has not been officially confirmed.
Diplomats and analysts said the episode showed two things:
First, Qatar's decision to join the hostilities was a pragmatic response to pressure from fellow Gulf Arabs, who have rebuked Qatar for backing Islamists during Arab Spring revolts.
Second, diplomats say, Qatar's reticence about its role suggests that it is also being careful to preserve influence with Islamist forces it believes are the long-term future.
Three years after the start of the Arab Spring, the Middle East is experiencing a backlash against political Islam, and Qatar is trimming its policies. In so doing, the contradictory nature of those policies is being exposed.
Qatar hosts the largest U.S. air base in the Middle East, owns swathes of Western real estate and is an enthusiastic customer for Western weaponry.
Yet it also provides haven to anti-Western groups such as the Afghan Taliban, Palestinian Hamas and Algeria's Islamic Salvation Front.
Their members frequent downtown shopping malls, rubbing shoulders with Western expatriates, and worship in mosques attended by Qataris and Muslim guest workers.
They live out of town in secluded districts.
North of Doha lies the town of Umm al-Amad, a huddle of farms and small mosques, which shelters a number of Syrians belonging to the al-Tawhid, one of dozens of armed Islamist factions fighting the government of President Bashar al-Assad.
Opinions that would invite the attention of the police in pro-Western Bahrain or UAE, are commonplace here.
In Umm al-Amad, the Egyptian director of a private religious school teaching young girls the Koran, said the Qatari government did not interfere with the school's teaching.
"What's happening these days is a war against Islam," she said. Then, apparently referring to Islamic State or the al Qaeda-aligned Nusra Front, she added: "Those fighters in Syria and Iraq fighting against the crusaders... have a just cause."
The breadth and resilience of Qatar's links to Islamist groups fuels suspicions in many other Gulf states.
Three of them - the UAE, Saudi Arabia and Bahrain - withdrew ambassadors from Qatar earlier this year in protest at what they saw as Doha's interference in their internal affairs.
That allegation - denied by Qatar - centres on Doha's backing for Egypt's Muslim Brotherhood and sister organisations that oppose the absolute rule of the Gulf's hereditary rulers.
The open rift among the Arab world's wealthiest countries has ramifications across the Middle East, because Qatar and its Gulf Arab critics find themselves backing rival forces in struggles from Libya and Egypt to Lebanon and Gaza.
Qatar has sought to soothe tensions.
In September, Qatar asked seven senior Brotherhood figures to leave the country, following months of pressure from neighbors to stop backing the Islamists.
Ibrahim Munir, a senior Brotherhood official based in London, told Reuters at the time that the departures did not mean a rupture in ties between Qatar and the Brotherhood.
However diplomatic sources in the Gulf say that to placate Saudi Arabia, another batch of Islamists including Brotherhood members would be leaving soon.
Other sources of dispute are Youssef al-Qaradawi, a prominent cleric associated with the Brotherhood, and Doha-based Al Jazeera news channel, which is accused by some Gulf states of promoting the Brotherhood, a charge the channel denies.
Qaradawi, whose sermons have often criticised Egypt's rulers, has spoken less frequently in public in recent months. Still, mistrust remains.
"The Muslim Brotherhood expulsions helped, and Qaradawi has been quiet," said a senior Western diplomat in the Gulf,
"But the Qataris are trying to do the absolute minimum."
Like members of foreign Islamist groups, Brotherhood people live in Qatar on condition that they do not cause any political disruption to the country's security or leadership.
But there is a grey area in the deal that worries Qatar's Gulf Arab neighbours.
"Qatar says that these Islamists cannot engage in political activity, but that's only related to their (Qatari) security, not to others' (security).
"Islamists here use Doha as an active launch pad for their media campaigns, communications and logistics which directly have an impact on the security of other Arab states," said an Arab diplomat in Doha.
Logos And Ransoms
Western diplomats in Doha say they have spotted cars with Islamic state logos driving around West Bay, one of Qatar's most affluent areas where the majority of expats live and work.
"Of course we were alarmed when we saw the logos, but we were told they were being watched closely by authorities and there isn't much to worry about," said a diplomat who spotted the logos.
The recent pragmatic tone in Qatari policy, diplomats and analysts say, is attributable to its new ruler, Sheikh Tamim bin Hamad al-Thani. His style is in contrast to that of his father Sheikh Hamad, who abdicated last year after steering the nation to global prominence in media, sports, finance and energy.
The extent to which Tamim is prepared to reduce ties to Islamists is not clear.
"The new emir is pragmatic, he doesn't want trouble ... sometimes you need to stay quiet for a while, to come back stronger," said a Qatari government consultant.
Qatar's critics say Doha continues to back militant Islamists in Libya and elsewhere and pays ransoms to militants for the release of hostages, helping to enrich radical groups, a charge Qatar denies.
Qatar's relationship with Nusra Front is a case in point.
Qatar was more hesitant than fellow Gulf states about the bombing campaign in Syria, in part because it was keen to avoid targeting sites of Nusra, an al-Qaeda affiliate with which Qatar has kept contact since the start of the uprising against Assad, said the security source close to the Qatari government.
Nusra was hit by U.S. planes on the campaign's first night.
Militant funding was brought up by Saudi Arabia's King Abdullah when Sheikh Tamim flew to meet him in Jeddah earlier this month to try to mend the rift in relations.
A senior Jeddah-based source said the king questioned Qatar's methods of freeing hostages and asked for tighter control on individuals in Doha financing "terrorist" groups.
Qatari officials deny paying ransom for hostages, but Western diplomatic sources in Doha say otherwise. Payment for captives is discouraged by Saudi Arabia and Washington.
A Qatari source involved in charity work and coordination of freeing political hostages told Reuters that in the case of the 13 Greek Orthodox nuns who were released in March by Islamist fighters in Syria, Qatar had paid for their release.
In August a German cabinet minister accused Qatar of financing IS militants. The United States has repeatedly expressed concern about funding from Arab states.
To try to put an end to the criticism, the Gulf state's leadership has spoken out.
"What is happening in Iraq and Syria is extremism and such organizations are partly financed from abroad, but Qatar has never supported and will never support terrorist organizations," said Sheikh Tamim during a visit to Germany in September.
The emir later issued a law to regulate charities involved in politics, as well as those that sent money abroad or received foreign financing, to try to crack down on any terror financing.
But in Qatar, what constitutes extremism is open for debate.