(CNN) -- Yemeni President Ali Abdullah Saleh told an Arab television network that he is "ready to step down with respect and dignity, even within a two hours' notice."

But Saleh, speaking to Al Arabiya television on Saturday, also warned that some leadership factions in the opposition have a "foreign agenda."

"The people are afraid of the Islamists," he said, cautioning against the influence of groups like al Qaeda inside Yemen. "The Arab world, including the Yemeni people, are terrified of the possibility that the Islamists will take control."

He described himself as a "constitutional president" and the country as "a ticking bomb."

"Everyone needs to look at Somalia and learn," he added, describing his country's tribal roots and the need for compromise.

The interview came one day after after the Yemeni president spoke to thousands at a pro-government demonstration in an effort to underscore his intentions to foster dialogue with anti-government protesters and make concessions to avoid bloodshed.

The embattled president said he would welcome either European mediators or those from the Gulf Cooperation Council to be impartial observers in the talks.

During Friday's demonstrations,Saleh told the crowd that while he is ready to hand over power, he won't do so to "gangs," "drug dealers" or the Houthi rebels fighting the government

Protesters have called for the ouster of the longtime president, who has ruled Yemen since 1978.

The country has been wracked by a Shiite Muslim uprising, a U.S.-aided crackdown on al Qaeda operatives and a looming shortage of water.

Protesters cite government corruption, a lack of political freedom and high unemployment that have fueled much of the anger among a growing young population steeped in poverty.

Last week, Saleh said he had accepted opposition demands for constitutional reforms and holding parliamentary elections by the end of the year.

He said in a written statement that he was "committed to undertaking all possible initiatives to reach a settlement" with the opposition JMP bloc and "prevent any future bloodshed of the Yemeni people."

According to the statement, he "has accepted the five points submitted by the JMP, including formation of a government of national unity and a national committee to draft a new constitution, drafting a new electoral law and holding a constitutional referendum, parliamentary elections and a presidential vote by the end of the year."

Saleh has also promised not to run for president in the next round of elections.

The president's standing has weakened after some government officials and military officers declared their support for the opposition Monday in the wake of a crackdown on protesters that left 52 people dead last week.

During Saturday's interview, Saleh said clashes had resulted in 41 deaths.

U.S. Secretary of State Hillary Clinton has called for full political dialogue in Yemen involving all players to find a peaceful solution.

Saleh, who has been in power for 32 years, has been a staunch U.S. ally in the fight against al Qaeda in the Arabian Peninsula.

Last week, Yemen's parliament approved a 30-day extension of emergency powers Saleh declared in response to protests.

The emergency law expands the government's powers of arrest, detention and censorship.

CNN's Saad Abedine and Mohammed Jamjoom contributed to this report