ISLAMABAD (Reuters) - Weeks of mounting anti-government protests in Pakistan had been enough to convince five of the powerful army's 11 Corps Commanders that it was time for them to step in and force embattled Prime Minister Nawaz Sharif to resign.

According to a minister close to military circles, top generals met in the garrison city of Rawalpindi at the end of August as demonstrations raged in nearby Islamabad. Thousands of protesters had just tried to storm Sharif's residence.

At the tense, four-hour conclave, Pakistan's democratic process was once again in peril, with the military pondering another intervention in a country that has seen power change hands more often through coups than elections.

But army chief Raheel Sharif decided the time was not right to overthrow the civilian leadership, and moved to quell any disagreement in his ranks by overruling the hawks and declaring the crisis must be solved through politics, not force.

Soon afterwards, the army issued a brief statement, reaffirming its commitment to democracy, and the threat of a coup, at least for now, had passed.

The minister, who declined to be named due to the sensitivity of discussing the inner workings of the military, said at least five generals had been pushing for weeks for the army to take a more "active role" in defusing the crisis.

"The time for the army to be neutral is over," was how the minister summed up the message from dissenters around the table.

Two military sources confirmed this version of events. They, like the minister, spoke on condition of anonymity.

A senior security source added: "Raheel Sharif is not interested in direct intervention. The tanks aren't going to come rolling in. This army believes in compromise."

The army's media wing confirmed Sunday's meeting but declined to share details. Defense Minister Khawaja Asif told Reuters the army was a "monolithic institution".

"What comes out from the army is ultimately one opinion," he said. "And ... they have supported democracy."


BIDING HIS TIME?

General Sharif, who is not related to the prime minister, may simply be biding his time.

If, with the help of tacit military support, Nawaz Sharif does manage to ride out twin protest movements led by cricketer-turned-opposition leader Imran Khan and activist cleric Tahir ul-Qadri, he is expected to emerge a diminished figure.

It would allow the armed forces to assume greater control of policy areas they most covet - security and foreign policy - and leave it to civilians to face public anger over internal problems such as a faltering economy and widespread power cuts.

A government insider told Reuters in August that Sharif had been assured by the military he would not be asked to step down and that there would be no coup. But in return his government would have to "share space" with the army.

Under the agreement, Sharif would be subservient to generals on issues he had wanted to handle himself - the fight against Taliban militants, relations with arch-foe India and Pakistan's role in neighboring Afghanistan after NATO combat troops withdraw at the end of 2014.

The army chief's cautious stance may have been linked to the strong show of support for the prime minister this month in parliament, where politicians lined up to back him.

General Sharif also inherited the current team of commanders from his predecessor when he took over the top job last year, making him less secure of his position, insiders said.