Under pressure from protesters and regional allies, Yemen’s President said on Saturday he will sign a deal to step down after 32 years in power. Still, he condemned the proposal as “a coup” and warned the U.S. and Europe that his departure will open the door for al-Qaeda to seize control of the fragile nation on the edge of Arabia.

The mixed signals from Yemen’s embattled president, Ali Abdullah Saleh, followed two earlier promises by him to sign the proposal. Both times he backed away at the last minute, adding to the opposition’s deep mistrust of a leader known for the adept political manoeuvring that has kept in power for decades.

In a sign that he may be ready to sign this time, the coalition of opposition political parties involved in the talks with Gulf Arab mediators was persuaded to sign the deal on Saturday, a day ahead of Mr. Saleh, based on what it said were guarantees that the president would follow through.

“We accept the initiative to stop bloodshed,” Mr. Saleh said in a televised speech, and an official statement earlier in the day said he would sign the deal on Sunday.

The proposal, mediated by a six-nation regional bloc called the Gulf Cooperation Council, grants him immunity from prosecution if he leaves office within 30 days. It is far from certain, however, whether it would satisfy all of the many different groups protesting his rule in the streets.

Mr. Saleh has managed to cling to power in the face of near daily protests by hundreds of thousands of Yemenis fed up with corruption and poverty. Like other anti-government movements sweeping the Arab world, they took inspiration from the popular uprisings in Tunisia and Egypt.

The president has swung between offering concessions, taking them back and executing a violent crackdown that has killed more than 150 people, according to the opposition, which says it compiled the tally from lists of the dead at hospitals around the nation.

The bloodshed triggered a wave of defections by ruling party members, lawmakers, Cabinet ministers and senior diplomats. Mr. Saleh’s own tribe has joined those demanding his ouster. Most importantly, several top army commanders, including a long-time confidant who heads a powerful armoured division, joined the opposition and deployed their tanks in the streets of the capital, Sanaa, to protect the protesters.

Mr. Saleh has been able to survive thanks to the loyalty of Yemen’s most highly trained and best-equipped military units, which are led by close family members.

That has raised concerns the political crisis could turn into an armed clash between the rival military forces if a deal is further delayed.

Seeking to win some support in the West for his continued rule, Mr. Saleh has warned several times that without him, al-Qaeda would take control of the country.

“To the Americans and Europeans, al-Qaeda is coming and it will take control,” he said on Saturday, in his televised address to members of the security forces. “The future will be worse than the present.”

The United States, which had supported Mr. Saleh with financial aid and military equipment to fight the country’s dangerous al-Qaeda branch, has backed away from the embattled leader.

Secretary of State Hillary Rodham Clinton said on Saturday Yemenis have been suppressed throughout the country and innocent civilians have died.

“President Saleh needs to follow through on his commitment to transfer power,” she said in a statement. “The government of Yemen must address the legitimate will of the people.”

Al-Qaeda in the Arabian Peninsula has an estimated 300 fighters in Yemen and has been behind several nearly successful attacks on U.S. targets, including one in which they got a would-be suicide bomber on board a Detroit-bound flight in December 2009. The explosive device, sewn into his underwear, failed to detonate properly.

Opposition member Mohammed Ghalib Ahmed dismissed the president’s warnings about al-Qaeda.

“He is terrorizing the Americans and the West,” Mr. Ahmed said.

The proposal “first put forward in March by Saudi Arabia, Qatar, Kuwait, Oman, Bahrain and the United Arab Emirates” gives a clear timetable for a transfer of power.

One week after Mr. Saleh signs, the opposition takes leadership of a national unity government that will include representatives of Mr. Saleh’s party. Parliament will then pass a law granting him legal immunity and a day later “30 days after the deal is signed” he is to step down and transfer power to his deputy.

A month after that, presidential elections are to be held.

A Foreign Ministry official said representatives of the opposition signed the agreement on Saturday in the presence of U.S. and European Union ambassadors, along with the chief mediator, the Gulf council’s secretary-general, Abdullatif bin Rashid al-Zayani. The official spoke on condition of anonymity because he wasn’t authorized to speak to the press.

Mohammed al-Sabri, the opposition coalition spokesman, said they received assurances from Gulf and Western countries that Mr. Saleh would also sign.

In an indication of the lingering mistrust, the opposition refrained from making an official announcement until he does so.

A big question hanging over the proposal is whether it would end the street protests by youth movements and others who say the opposition parties taking part in the talks to end the crisis do not represent them.

They object to Mr. Saleh being shielded from prosecution and want to see him brought to trial on charges of corruption and ordering the killings of demonstrators.

They also want more sweeping changes to upend Yemen’s political scene, said Abdel Hadi al-Azazi, one of the protest organizers in the capital.

“We will keep on escalating our protests to topple the regime,” he said. “The initiative doesn’t mean anything to us. We can’t comment on it because we have nothing to do with the signing or the initiative.”

“Transfer of power, for us, doesn’t only mean exclusion of the head of the regime but it means toppling the regime and all centres of power and its tools.”

More In: International | News