By Mehreen Zahra-Malik

ISLAMABAD (Reuters) - Leaders of Pakistani protesters trying to bring down Prime Minister Nawaz Sharif were talking with the government on Thursday on a way out of an impasse that has raised fears for the nuclear-armed country's political stability.

Former cricket star Imran Khan and cleric Tahir ul-Qadri, who controls a network of Islamic schools and hospitals, have been leading protests in the capital, Islamabad, since last Friday.

About 2,000 demonstrators gathered on the main road outside parliament for a second day on Thursday, hours after talks on an end to the turmoil finally got going.

"Yes, talks are on," said Ahsan Iqbal, a prominent member of parliament from the ruling party. "We are progressing."

Shahid Mursaleen, a spokesman for Qadri, also said their leaders had met negotiators.

Both Khan and Qadri want Sharif to resign over allegations of corruption and election rigging. Sharif, who won the last election, in May last year, by a landslide, has refused.

The protests have raised concern about stability in the country of 180 million people, at a time when the government is battling a Taliban insurgency and NATO troops are withdrawing from neighboring Afghanistan.

The confrontation has also shone a spotlight on the central issue in Pakistani politics: competition for power between the military and civilian leaders.

Some ruling party officials have accused elements within the military of orchestrating the protests to weaken the civilian government. The military insists it does not meddle in politics.

Most analysts doubt the military wants to seize power in a coup, and be forced to take responsibility for the country's dire economy and other problems.

'HERE TO STAY'

But there is a widespread perception that the military is benefiting from the protests in terms of its relations with the government, because the government has been forced to rely on it for security.

On Tuesday, the military said the two sides should engage in dialogue and warned that key government institutions were under its protection.

There have been indications that the military was frustrated with the government, in particular over the treason trial of former military chief and ex-President Pervez Musharraf, who deposed Sharif in a 1999 coup.

There has also been disagreement between the government and the army on how to handle the Islamist militants attacking the state, and on relations with old rival India.

The army has traditionally seen internal security and foreign relations as its domains.

On Tuesday, protesters used a crane and bolt cutters to force their way past barricades of shipping containers to push into central Islamabad's government and diplomatic heart.

Khan had threatened to march on the prime minister's house if Sharif did not resign, but later backed off that vow after the military issued a statement calling for dialogue.

Mursaleen, Qadri's spokesman, said the protesters' demands included the resignation of the entire government and the registration of a murder case against the government over the killing of some of Qadri's supports in clashes with police.

"We are here to stay until these demands are met," he said.

On Thursday, Sharif was scheduled to address parliament but he did not. His office declined to comment.

(Additional reporting by Katharine Houreld; Editing by Robert Birsel)