SANAA - The fate of a Gulf-mediated deal to ease Yemeni President Ali Abdullah Saleh out of power could hang on how he handles mass protests on Friday, two days after plainclothes gunmen shot dead 12 demonstrators in Sanaa. Opponents of the agreement, due to be signed in Riyadh on Sunday, have called for rallies across Yemen on the Muslim day of prayer to demand the veteran leader's immediate exit. Even the opposition coalition that is party to the compromise warned Saleh on Thursday that any more violence against demonstrators could scupper the transition plan. "In the event of your inability to protect protesters, we will find ourselves unable to pursue an agreement that the regime seeks to use to shed more blood," the coalition said. Funerals of the 12 protesters killed on Wednesday were expected to draw big crowds in the Yemeni capital, rocked by three months of demonstrations seeking to match the success of popular revolts against autocrats in Egypt and Tunisia. Saleh, facing the gravest challenge to his 32-year rule, was expected to speak at a rally of his supporters marking what they were calling a "Friday of Constitutional Legitimacy". The United States and nearby top oil producer Saudi Arabia want the standoff resolved to avert chaos that could enable a Yemen-based wing of al Qaeda to operate more freely. Wednesday's killings capped a day of protests by tens of thousands of Yemenis, many denouncing the transition plan that would give Saleh a month-long window to resign ��" time his foes fear he could use to find more manoeuvres to stay in power. Saleh, deeply distrusted by many of his people, has accepted the deal in principle, but raised a snag on Thursday when he objected to Qatari officials attending the signing ceremony. "We will have reservations about signing if representatives of Qatar are present among the Gulf foreign ministers," he told the Arabic-language Russia Today channel. "(Qatar) is involved in a conspiracy not just against Yemen but all Arab countries." Saleh, who has in the past accused Qatar's Al Jazeera satellite channel of provoking the protests, also accused the tiny, gas-rich Gulf state of funding the opposition in Yemen. His remarks evoked derision on the streets of Sanaa. "The president is looking for ways to evade signing the Gulf initiative, so now he's using the excuse of Qatar. Next time he'll look for another excuse," said one woman, Aida Mohammed. Marzouq Saleh, another passerby, was equally scathing. "All Arab presidents are angry with Qatar because of Al Jazeera, including President Saleh. Oppressive regimes don't like coverage of the revolutions. But we, the people, are happy." A government official has said Saleh will sign the agreement on Saturday in Sanaa, but send Abdel-Karim al-Iryani, vice president of his ruling party, to the official signing ceremony in Riyadh. The opposition coalition will also sign on Sunday. The balance of power has tipped against Saleh, long seen in the West as a vital if inconstant ally against al Qaeda, after weeks of violence, military defections and political reversals. Many of the youthful demonstrators, who include students, tribesmen and activists, have vowed to stay in the streets until Saleh steps down. They owe no obedience to the established opposition parties, comprised of Islamists, Arab nationalists and leftists, which have cooperated with Saleh in the past. The deal, brokered by the six-nation Gulf Cooperation Council, would give Saleh and his entourage immunity from prosecution. The president would have 30 days to resign. He would appoint a prime minister from the opposition to head a transitional government until a presidential vote 60 days later. At least 142 protesters have been killed in unrest in Yemen, the poorest Arab country. Some 40 percent of 23 million Yemenis live on $2 a day or less, and a third face chronic hunger. The Interior Ministry said on Thursday that more than 21 policemen had died and 1,000 had been wounded since Feb. 3. On Thursday night armed men fired on state security offices in Zinjibar in southern Yemen, killing one soldier. Gunmen also clashed with guards outside the central bank in the port city of Aden, a local official said. One gunman was killed and three soldiers were wounded. Three passersby were also hit.