By Paul Adams
BBC News, diplomatic correspondent
Yemeni officials were quick to condemn Monday's car bomb attack at a temple in Marib, in which nine people, including seven Spanish tourists, died, as the work of al-Qaeda.
Yemen has a long history of militant Islamism
It also emerged that they were expecting a terrorist act, but were not sure what form it would take.
President Ali Abdullah Saleh said a warning had been received "about four days ago" and that security had been stepped up around sensitive sites, such as oil installations, "but we did not think of this temple".
Yemen's oil industry, tiny by global standards, but the source of two thirds of Yemen's GDP, has been hit in the past.
Last September, al-Qaeda affiliates were blamed for two attacks on Western-owned oil refineries. One refinery, at Safer, is close to Marib.
An al-Qaeda message at the time warned that these attacks were "only the first spark" and that future operations would be "severe and bitter".
Thirty six suspects went on trial in the capital, Sanaa, accused of membership of an organisation calling itself al-Qaeda Organisation Cell in the Arabian Peninsula-Yemen.
In fact, Yemen has a long history both of militant Islamism and regional instability.
Tribes, including some in the Marib area, have had an uncomfortable relationship with central government for decades.
Islamist safe haven
Kidnappings of Yemenis and tourists have long been used to back up demands for better services or the release of jailed relatives.
Usually hostages are released unharmed, but in 1998, four Westerners were killed during a botched rescue attempt.
Despite the country's stunning scenery and rich cultural heritage, tourism has always been a fragile industry in Yemen. A three-year Shia rebellion in the north and occasional attacks in Sanaa have caused Western governments to issue warnings.
In recent weeks, both Spain and the US have advised travellers not to visit the country.
Yemen is home to cultural treasures but unrest has hurt tourism
Before 11 September 2001 attacks in Washington and New York, Yemen was regarded as a safe haven for radical Islamists. Osama bin Laden's ancestral homeland, its long porous border with Saudi Arabia and rugged mountainous terrain attracted militants who saw it as a place where they could hide, train and organise.
In 2000, an audacious suicide attack was launched against the American warship, USS Cole, anchored off the southern port of Aden. Seventeen American sailors were killed.
After the attacks on America President Saleh joined President George W Bush's "war on terror". The government cracked down on militants and allowed the CIA to keep a close eye on al-Qaeda movements.
This resulted, in May 2002, in the killing of a senior al-Qaeda operative, Qaed Salim Sinan al-Harethi, a suspect in the USS Cole bombing. His car was attacked (near Marib) by a Hellfire missile launched from an unmanned Predator drone.
Later that year, a French supertanker, the Limburg, was attacked near Mukallah.
The Sanaa government's efforts to curb the militants suffered a setback in February last year when 23 convicts, including men the US state department described as "known affiliates of al-Qaeda," escaped from prison.
In 2002 a French supertanker was attacked off Yemen's coast
The Marib attack is not the first time Spanish nationals have been targeted by al-Qaeda inspired militants. In 2004, 191 people were killed as a series of bombs exploded aboard commuter trains in Madrid.
Final evidence in the trial of alleged perpetrators was submitted only yesterday.
And just over a week ago, a remotely-activated car bomb killed six Spanish peacekeepers on duty in southern Lebanon. The finger of suspicion is being pointed at a group thought to have links to al-Qaeda.
Spain's police federation said on Monday that the country had become "a major target" for Islamic terrorism.