Alex Salmond's legal challenge to the Scottish government's handling of complaints about sexual misconduct against him will be heard in the new year.
Officials investigated two allegations of sexual harassment against the former prime minister, whom he strongly denies.
He also claimed that the way the government treated the complaints was unfair to him and started a judicial review.
From January 15, 2019, a four-day hearing will take place in the Court of Session.
A separate police investigation into the accusations is underway and will not be affected by the judicial review, which is entirely focused on the government's processes.
The government said that the complaints against Mr. Salmond "could not be ignored or swept under the carpet", and said it would "defend its position" vigorously.
- Salmond allegations: what do we know?
- Profile: Alex Salmond
In January, two complaints were addressed to the government shortly after it had set up a new trial to deal with allegations of sexual harassment.
The complaints relate to alleged events in 2013, when Mr. Salmond was prime minister.
He said that the government's subsequent investigation was "unfair and unjust" and stopped the SNP during the launch of a crowdfunder to help pay for a legal review of the trial.
The former MP and MSP said that he had not been given an opportunity to "see and challenge the case against him" and that he "was not allowed to see the evidence".
He also described the accusations as "obviously ridiculous" and claimed that someone within the government "flagrantly and repeatedly" violated the confidential complaint process by leaking details to the Daily Record newspaper.
The government replied that it "was convinced that our processes are legally justified" and added that there were "a number of inaccuracies in Mr Salmond's public statements" that would be dealt with in court.
It also said that the investigation was "completely confidential" and said it would "vigorously" defend the new processes.
A hearing will take place in Edinburgh on 6 November before the substantive arguments are presented in four days in January.