* Fiery cleric wins say in pre-election electoral process
* Military denies links to protests
* Official refuses Supreme Court order to arrest prime minister
By Mubasher Bukhari
ISLAMABAD, Jan 17 (Reuters) - A Muslim cleric with a history of ties to the military who has been calling for the Pakistani government to resign reached a deal with the administration on Thursday that will give him a say in the electoral process ahead of elections.
Muhammad Tahirul Qadri triggered a political crisis by launching mass protests in the capital four days ago. He has been calling for the military to play a role in the formation of the caretaker administration that takes over in the run-up to scheduled elections.
"We have reached an agreement," Qadri, who supported an army coup in 1999, told supporters camped out near parliament. "Allah granted us a victory and now you can go home."
Qadri persuaded the government to dissolve parliament before a scheduled date of March 16 so that elections, due in May, can take place within 90 days, and also to discuss electoral reforms, according to a copy of the agreement released by his spokesman.
A government source and officials in the ruling Pakistan People's Party said Qadri's demand that the army be consulted on the make-up of the interim administration had been rejected.
But it was agreed that the ruling coalition and his party must reach a "complete consensus" on the proposal of a caretaker prime minister.
Qadri's appearance at the forefront of Pakistan's political scene has fuelled speculation that the army, with its long history of involvement in politics, has tacitly endorsed his campaign in order to pile more pressure on a government it sees as inept and corrupt. The military denies this.
The cleric, who has been delivering long, fiery speeches from behind a bullet-proof glass box, has many followers who back his religious charity, which has offices in 80 countries.
But he also appeals to middle- and lower-class Pakistanis disillusioned with dynastic politics.
No civilian government has ever completed its full term, but current army chief General Ashfaq Kayani has vowed to keep the military, which has ruled Pakistan for more than half of its 65 years since independence, out of politics.
The PPP has come under fire for failing to tackle a range of problems, from a Taliban insurgency to a weak economy.
Pakistan's government got some relief earlier on Thursday when the chief of the state's anti-corruption agency rejected a Supreme Court order to arrest Prime Minister Raja Pervez Ashraf.
The court had ordered Ashraf's arrest over allegations of corruption in transactions involving power plant rentals when he was power minister.
Fasih Bokhari of the National Accountability Bureau told the court that investigations of the allegations were incomplete.
The court asked Bokhari to produce case records so that it could decide whether there was enough evidence to prosecute. The case was adjourned until Jan. 23, judges said.
Fresh troubles may be brewing on another front for the government, which has been heavily criticised for its failure to strengthen the economy, fight militancy and eradicate poverty.
The Supreme Court has admitted a petition filed against Sherry Rehman, Islamabad's ambassador to the United States and a prominent member of the PPP, that accuses her of committing blasphemy.
Court documents show that the police have been directed to investigate the allegations. Rehman has faced death threats from militants for calling for reforms of Pakistan's anti-blasphemy law, which has been condemned by human rights groups.