SANAA - A U.N. envoy said on Tuesday a deal on power transfer in Yemen had been reached and details on signing the accord were being worked out, but three previous attempts to secure the deal have seen President Ali Abdullah Saleh back out at the last minute.

A Yemeni official said a main obstacle to signing the accord was coming from senior politicians in Saleh's ruling General People's Congress (GPC) strongly opposed to signing the accord.

We have an agreement. We're working out the signing, United Nations envoy Jamal Benomar, who has been shuttling between the two sides, told reporters in Sanaa.

A Western diplomat confirmed an agreement on power handover has been reached but said that Benomar was still discussing details related to its signing.

Under a plan crafted by Yemen's six Gulf Arab neighbours, Saleh would transfer his powers to his deputy, Abd-Rabbu Mansour Hadi, ahead of an early election.

However, Saleh has repeatedly failed to sign the deal, which aims to end months of protests that have paralysed the country.

The Yemeni official, who asked to remain anonymous, said that Saleh was trying to reassure officials in his party to drop their opposition to the accord and to convince them that the GCC plan is the best way forward.

The official also said that renegade general Ali Mohsen, who had broken away from the Yemeni army after protests began in February, and tribal leader Sadeq al-Ahmar, who are not part of the accord, may try to obstruct it.

Officials from an alliance of opposition parties and a source in the GPC said on Monday that a deal had been reached, and that the accord would be signed on Tuesday.

Benomar was expected to hold a news conference later in the day.

Under the accord, Saleh would keep the title of president after handing all of his powers to Hadi, who will form a new national unity government with the opposition and call an early presidential election within three months.

More than 10 months of protests aimed at ending Saleh's 33-year rule have paralysed Yemen. The renewal of conflicts with Islamist militants and separatists during the political deadlock has raised the prospect of chaos on the borders of Saudi Arabia, the world's largest oil exporter.

Those fears are shared by Saleh's erstwhile U.S. backers, who made him a cornerstone of their campaign against al Qaeda, and have brokered negotiations over implementing the Gulf plan.

Tribesmen battling forces loyal to Saleh in the Arhab region north of the capital said they attacked loyalist positions on Tuesday and were shelled in return.

Activists in the southern city of Taiz, a centre of anti-Saleh protests and sporadic clashes between his forces and tribal militias, said a demonstrator was killed by mortar fire from troops loyal to Saleh.

Shipping sources and traders said on Tuesday the country was seeking additional fuel imports due to the shutdown of the largest fuel refinery, in the southern city of Aden, following attacks on its main feed pipeline in October.

(Reporting by Mohammed Ghobari and Humeyra Pamuk, writing by Sami Aboudi)