"The Pakistan Army played a positive role to stabilise the situation and demonstrated a commendable commitment to the constitution, rule of law and democratic political system," the Information Minister, Mushahid Hussain, said.
It was the first time Mr Sharif's government had publicly acknowledged the support which Western diplomats believed the powerful military gave to end weeks of constitutional paralysis.
The army itself made no comment on its role. Last week, it denied having any designs on power after media reports suggested that a return to martial law, last in force in 1985, was imminent because of the standoff between Mr Sharif and the judiciary and president.
Earlier yesterday, Ajmal Mian was sworn in as acting chief justice. Mr Mian was ordered to act as an interim chief justice after a bench suspended chief justice Sajjad Ali Shah on Tuesday. Mr Shah's removal prompted the resignation on Tuesday of Mr Leghari, who had been at odds with Mr Sharif for months in a power struggle that threatened constitutional breakdown.