A £500,000 damages claim brought against the Scottish government by the former chairwoman of a child abuse inquiry has been thrown out of court.
A judge ruled Susan O'Brien QC's compensation claim should be dismissed.
He said she had failed to plead a relevant case of breach of contract or infringement of article 8 of the European Convention of Human Rights.
Lord Pentland held that the case advanced on behalf of Ms O'Brien for breach of contract was "misconceived".
He ruled that the article 8 breach arguments of the action, covering the right to respect for private and family life, were "unsound".
Ms O'Brien was appointed to head the Scottish Child Abuse Inquiry in July 2015 but resigned a year later after facing the sack over "unacceptable" comments.
She was replaced by High Court judge Lady Smith.
'Proportionate and fair'
Ms O'Brien raised an action for damages at the Court of Session in Edinburgh.
She had sought an order from the court declaring ministers' actions in invoking procedure under the Inquiries Act 2005, proposing to terminate her appointment, amounted to a breach of contract and were incompatible with her rights.
The Scottish government said it welcomed the decision to dismiss the damages claim.
A spokesman said it confirmed "that ministers acted lawfully in exercising their responsibilities under the Inquiries Act 2005 and other relevant legislation".
The spokesman added: "The judge has confirmed that the decision by ministers to undertake an investigation was, in the circumstances, appropriate, proportionate and fair.
"The focus of the Scottish government remains on supporting the successful operation of the independent public inquiry."