Pakistan's powerful military has stepped back into politics, agreeing to mediate between the government and protesters demanding the resignation of prime minister Nawaz Sharif over alleged voting fraud.

Imran Khan and cleric Tahir-ul-Qadri, who have led anti-government protests, met army chief Raheel Sharif late on Thursday after saying they had agreed to his role as "mediator and guarantor'' in talks with the prime minister.

It is the army's first overt involvement in politics in a year since Sharif became prime minister in Pakistan's first democratic transfer of power.

The country's defence minister, Khwaja Mohammad Asif, welcomed the army's offer, which came after Sharif asked it to broker talks. "I think we should view it positively that the army is playing a constitutional and legal role,'' said Asif.

When the government invited the army ... the government is thinking that there is no political means to end this crisis.

Imran Khan, opposition leader

However, Khan said he had "made it clear" that "there can't be an independent investigation so long as Nawaz Sharif is prime minister".

He later told a gathering of supporters:  "When the government invited the army to come in the middle, then the government is thinking that there is no political means to end this crisis."

He has called on his supporters to re-convene at the Islamabad protest site by 13.00 GMT on Friday.

Sharif himself was removed from office during a previous stint as prime minister in a military coup in 1999, and his decision to bring treason charges against the former military ruler Pervez Musharraf, who overthrew him in 1999, is believed to have angered the military.

Sharif has faced a two-week-long protest in Islamabad by supporters of Khan and Qadri, which at their height brought tens of thousands of people into the government quarter.

The mediation offer also came after police filed charges of abetting murder against the prime minister and others over the killing of 14 Qadri supporters during clashes with police in June in the eastern city of Lahore.

The police accepted the charges following a complaint by Qadri's Minhaj-ul-Quran organisation.

The criminal case names 20 other defendants, including Sharif's younger brother Shahbaz, who serves as chief minister of the eastern Punjab province, as well as other ministers and police officers, said police officer Sharif Sindhu.

Shabaz has previously rejected the claims, and offered an independent inquiry into the deaths.

Source: Al Jazeera and agencies