Image caption Ms Clinton criticised Arab rulers for a lack of reform during a visit to Doha on Thursday

When 26-year-old Tunisian Mohamed Bouazizi lost hope in the future and set himself on fire on 17 December, no-one expected it would be the undoing of the 23-year-long rule of Zine al-Abidine Ben Ali - including Washington.

In fact when reporters asked for a comment about the growing unrest in Tunisia on 4 January, two weeks after the self-immolation, State Department officials seemed to be caught unaware and said they had not been briefed about Tunisia recently.

The following day, American officials offered a bit more, but focused mostly on the advisory issued to American citizens in Tunisia.

By the end of the week, the Tunisian ambassador in Washington had been summoned for an explanation about the use of violence by the authorities against protestors and the US was urging Tunisia to respect the freedom of assembly.

But despite its slow response, described by critics as neglect, the US can probably still turn to other Arab rulers now and say "I told you so".

'Sinking into the sand'

On Thursday, while the popular demonstrations were growing in size in Tunisia, Hillary Clinton was speaking in Doha, at the Forum for the Future, unleashing a scathing attack on Arab rulers for the lack of reform, corruption and repression that plague the region.

It was a familiar litany but this time it was delivered with unusual vehemence.

"In too many places, in too many ways, the region's foundations are sinking into the sand," she said.

Ms Clinton's speech in Doha showed a new level of sophistication in understanding what ailed the Arab world and how best to best to address it Kim Ghattas Follow Kim on Twitter

"The new and dynamic Middle East that I have seen needs firmer ground if it is to take root and grow everywhere."

A senior US official said Ms Clinton had grown frustrated and tired of speaking about the need for reform and opportunities for young people for two years with no real response from Arab leaders. Her speech was intended as a wake-up call, a warning that their attitude to ruling was dangerous and untenable.

"Those who cling to the status quo may be able to hold back the full impact of their countries' problems for a little while, but not forever," she said, a warning which seems prescient in the wake of Tunisian events.

"If leaders don't offer a positive vision and give young people meaningful ways to contribute, others will fill the vacuum."

The aim was to press Arab leaders to undertake their own reforms and offer a better future for their people as a real guarantee against extremism and perhaps even a guarantee for their own survival.

Washington has often worried about what the alternative to allied regimes in the Arab world would look like, and the fear of Islamist groups taking over in the region has stopped the US from pushing harder for change in the region.

Tunisia co-operated closely with Washington on counter terrorism and shared information about radical groups in North Africa. When the protests spread, Mr Ben Ali claimed the protesters were extremists, perhaps in the hope it would get him Western support.

Ms Clinton's speech in Doha showed a new level of sophistication in understanding what ailed the Arab world and how best to best to address it.

Applause from Obama

Washington's handling of the Tunisia developments was careful.

Asked about the protests at the beginning of the week, Ms Clinton emphasised the need for reform and respect for the protesters' rights to assemble, but also stressed that Washington was not taking sides - perhaps for fear the US would be accused of stoking the unrest.

Image caption Some accuse the US of paying lip service to democracy while supporting autocratic Arab leaders, such as Hosni Mubarak

The aggressive approach of the Bush administration as it tried to implement its "freedom agenda" in the Arab world often ended up alienating not just leaders but also those who were meant to be "freed".

Ms Clinton's comments about Tunisia and her speech in Doha were meant to strike a balance between that and the more subtle, hands-off approach of the Obama administration over the last two years which wasn't seen to be delivering results.

By Friday, President Obama issued a statement applauding the "courage" of Tunisians protestors and their "brave" struggle.

Washington has often been accused of paying lip service to human rights and democracy, calling for greater freedoms while supporting autocratic rulers around the Arab world, from Hosni Mubarak of Egypt to Jordan's King Abdullah and the Saudi King Abdullah.

But the senior official said US foreign policy could not be about overthrowing those regimes, even if Washington wanted them to be and act different.

The official acknowledged that the US looked after its interests first and supported someone like Yemen's president, Ali Abdullah Saleh, because it was in America's national security interest.

But he insisted that Washington also wanted those countries to clean up their act, because this served everybody's interest.

Engagement

Ben Ali's fall from power Image caption Zine al-Abidine Ben Ali was only Tunisia's second president since independence from France in 1956 17 Dec: Man sets himself on fire in Sidi Bouzid over lack of jobs, sparking protests

Man sets himself on fire in Sidi Bouzid over lack of jobs, sparking protests 24 Dec: Protester shot dead in central Tunisia

Protester shot dead in central Tunisia 28 Dec: Protests spread to Tunis

Protests spread to Tunis 8-10 Jan: Dozens of deaths reported in crackdown on protests

Dozens of deaths reported in crackdown on protests 12 Jan: Interior minister sacked

Interior minister sacked 13 Jan: President Ben Ali promises to step down in 2014

President Ben Ali promises to step down in 2014 14 Jan: Mr Ben Ali dissolves parliament after new mass rally, then flees Profile: Zine al-Abidine Ben Ali Tunisia holidaymakers back in UK

A diplomatic cable dated July 2009 from the US embassy in Tunisia, published by Wikileaks and sent by then ambassador in Tunis Robert Godec, shows him sounding the alarm about the internal situation.

"Anger is growing at Tunisia's high unemployment and regional inequities. As a consequence, the risks to the regime's long-term stability are increasing," wrote Mr Godec, as he deplored Tunisia's reluctance to engage with the US in a meaningful way.

"The (Government of Tunisia) declined to engage on the Millennium Challenge Account; declined USAID regional programs to assist young people; reduced the number of Fulbright scholarship students (…),"he added.

In his cable, Mr Godec recommended continuing to press the government on its democracy and human rights practices, but not in public, while trying to intensify engagement with opposition parties and civil society, and offering more educational services to Tunisian youth.

The ambassador also urged Washington to persuade European countries to step up their efforts to convince Tunisia to accelerate political reform, pointing out that France and Italy were reluctant to do so.

Events are still unfolding in Tunisia, but asked whether Washington was heartened or worried by events so far, the senior American official said no one was fretting at the thought that more popular revolts could take place in the region.

But he indicated that what the US really wanted was to see other countries take note and accelerate reforms.