The militiamen, armed with knives and swords, blocked the entrances to the UAE mission, where Jonathan Wilks, along with the US representative and three Arab ambassadors, had gathered, expecting Mr Saleh to arrive to sign the agreement.
Finally in the evening, Yemeni military helicopters landed at the embassy and ferried the diplomats out, taking them to the presidential palace. There, they witnessed several Yemeni ruling party officials sign the accord. But Mr Saleh, shown on state TV standing alongside the US ambassador, did not sign.
Mr Saleh said later he would not do so unless opposition leaders attend and sign it as well in public, not "behind closed doors".
"If they don't comply, they are dragging us to a civil war, and they will have to hold responsibility for the bloodshed in the past and the blood which will be spilled later on because of their stupidity," Mr Saleh warned in an address on state TV.
The developments threatened to wreck a Gulf Arab-mediated accord that diplomats hope could resolve the turmoil that has raged in Yemen for the past three months, with tens of thousands of protesters demanding Mr Saleh step down after 32 years in power, and his regime unleashing a deadly crackdown. The accord calls for Mr Saleh to step down in 30 days and hand power to his vice-president, in return for immunity from prosecution.
A coalition of opposition parties signed the agreement in private on Saturday, and Mr Saleh promised to sign it the following day.
He has backed away from signing the deal at least twice before. A Gulf official in the Saudi capital, Riyadh, warned that the Gulf Co-operation Council (GCC), the regional body that mediated the deal, would withdraw from mediation if Mr Saleh did not sign. Throughout the day yesterday, hundreds of armed Saleh loyalists deployed in the streets of the capital Sanaa in what appeared to be a campaign orchestrated by his own regime, aiming to show that the public wants him to stay.
Dozens gathered in front of the police academy, where the ruling party general assembly had convened to discuss the deal. "We are coming under pressure, to reject the initiative," said Mohammed Saad, a member of the assembly. Others erected a big tent in one of Sanaa's main streets, blocking traffic and raising banners that read: "Don't go, don't sign!"
The diciest moment came when hundreds of Saleh loyalists, touting swords and knives, massed outside the UAE Embassy. They blocked its two main entrances, and at one point attacked a convoy bringing the GCC's chief mediator, secretary-general Abdullatif bin Rashid al-Zayani, to the building. They pounded on the car, tried to prevent it from entering the compound.