Alex Salmond has formally started his legal action against the Scottish government over its handling of sexual misconduct complaints against him.
Two people have made allegations about the former first minister, who strongly denies ever sexually harassing anyone.
He is seeking a judicial review of a new complaints procedure that was introduced by the Scottish government in December.
The Scottish government said it would "defend our position vigorously".
Mr Salmond's petition has been lodged with the Court of Session in Edinburgh.
The court will now seek a response from the Scottish government. It is likely to be some weeks before there is a hearing before a judge.
The complaints about Mr Salmond were made in January - just weeks after the new procedures for dealing with harassment complaints was introduced with the blessing of his successor, Nicola Sturgeon.
Ms Sturgeon had asked for the Scottish government's existing policies to be reviewed and updated following wider concerns about harassment at Holyrood and Westminster.
Mr Salmond claims that the subsequent investigation into the allegations against him by senior Scottish government civil servants was "unfair and unjust".
He said he had been given no opportunity to "see and therefore to properly challenge the case against me" and that he had "not been allowed to see the evidence".
He has also described the allegations as "patently ridiculous", and has written to the Scottish government's top civil servant, Permanent Secretary Leslie Evans, urging her to investigate how the claims were made public.
Mr Salmond has claimed that someone within the Scottish government has "flagrantly and repeatedly" breached the confidential complaints process by leaking details to the Daily Record newspaper.
The Scottish government argues that a statement released by Mr Salmond last week contained inaccuracies about its procedures, and has insisted the complaints process has been "entirely confidential throughout".
A spokesperson said: "Matters of process will be resolved in court now Mr Salmond has lodged his petition and the government will defend our position vigorously.
"The judicial review will not address the complaints themselves - complaints which it was important for the Scottish government to address.
"As we set out last week there are a number of significant inaccuracies in Mr Salmond's statements and we will address those matters in court.
"But that should not be allowed to distract from the fact that there are two complaints that could not be ignored or swept under the carpet."
The Scottish government has passed details of the complaints to Police Scotland, and the force has said it is assessing the information.
The Daily Record newspaper says it has seen the wording of one of the complaints, which was made by a Scottish government staff member.
She alleges the former first minister touched her bottom and breasts through her clothing while she was alone with him at Bute House, the paper has reported.
The alleged incident is said to have taken place at the first minister's official residence Bute House in Edinburgh in the first week of December 2013.
The paper claims the woman has alleged "multiple incidences of harassment and conduct of an unwanted sexual nature".
Mr Salmond, who had two spells as leader of the SNP, led the devolved Scottish government as first minister from 2007.
He quit in the aftermath of the independence referendum in 2014, when Scotland voted to remain in the United Kingdom.