Scottish party leaders have clashed over the conduct of the justice secretary in the wake of the resignation of Phil Gormley as Police Scotland's chief constable.

Gormley's decision to quit on Wednesday in the face of five separate misconduct allegations against him means Scotland's national police force is seeking a third chief in five years.

Justice secretary Michael Matheson has come under scrutiny in recent weeks for intervening in a decision last year by the former chairman of Scotland's police watchdog to reinstate Gormley.

Speaking at First Minister's Questions on Thursday, Ruth Davidson also highlighted Matheson's role in appointing the new chairwoman of the Scottish Police Authority (SPA) Susan Deacon in November.

The Scottish Conservative leader said it was an "obvious flaw" to have the minister in charge of the appointment process for the independent police oversight body.

Scottish Labour's Richard Leonard reiterated previous opposition calls for Matheson to leave his post, asking Nicola Sturgeon if she would "find a new justice secretary".

The First Minister defended Matheson's actions related to the departed Police Scotland chief, saying that he behaved "entirely appropriately" and asked questions of the SPA's process which "could not be answered".

Andrew Flanagan, then-chairman of the SPA, had attempted in November 2017 to have the former chief constable return to active duty.

Gormley had been on special leave from September until his resignation from the force.

Matheson met Flanagan, who also quit his role following previous claims of misconduct, to ask if proper procedure had been followed in the decision to reinstate the chief constable.

After that, the decision was reversed.

Opposition parties have claimed this amounts to potentially unlawful ministerial meddling in a nominally independent body, an accusation Matheson strongly rejects.

Davidson said the Scottish Parliament should be in charge of senior appointments to the SPA, as it is for a number of other statutory watchdogs, rather than the justice secretary.

She told the First Minister the current arrangement was not "true independence", adding: "As this affair has shown us, that same justice secretary can pull the head of the Scottish Police Authority into a room and make him change his mind."

Davidson continued: "If the First Minister is serious about strengthening the structure and oversight of the single police force then having its chair appointed by parliament and not at the grace of ministers ... is a good place to start."

Sturgeon said primary legislation would be needed to do that, with the Tory leader responded: "Guess what First Minister, this is a parliament - changing the law is what we do."

The First Minister said new SPA chairwoman was "doing an excellent job", adding: " I think we should get behind her in that.

"I think we should consider in the fullness of time before we come to appoint a new chair, whether there is changes necessary."

Leonard urged Sturgeon to consider the findings of a Labour review of policing led by former MSP and ex-police officer Graeme Pearson.

The 2015 report made ten recommendations including improved parliamentary oversight and staffing support.

He said: "Week after week the First Minister stands up in this chamber and demands solutions from opposition parties, solutions to problems which her government has created in the first place.

"Labour offered ten but her justice secretary ignored them.

"Since then two chief constables have gone, morale amongst rank-and-file officers has sunk, public confidence has declined, and all the time the First Minister refuses to take responsibility."

He added: "Will she look again at the recommendations of the Pearson review and will she find a new justice secretary to deliver them?"

Sturgeon responded: "There has been a governance review under way, that will report shortly and all of us right across the Parliament can consider any proposals and suggestions that come forward as part of that."