An employment tribunal has ruled that equality law protects an employee's belief in Scottish independence.
It came at a preliminary hearing on Chris McEleny's case against his former employer, the Ministry of Defence.
Mr McEleny, an SNP councillor and former candidate for his party's deputy leadership, claims he was unfairly targeted because of his views.
Judge Frances Eccles has agreed that his support for independence qualifies as a "philosophical belief".
The case will now proceed to a full hearing.
The claim by Mr McEleny, the SNP group leader on Inverclyde Council, concerns his treatment by the Ministry of Defence (MoD) when he announced he was running for the post of deputy leader in the party in 2016.
He was employed as an electrician at the MoD munitions site in Beith, North Ayrshire.
Mr McEleny said that around the time of the leadership hustings, he was told his security clearance had been revoked and that he was suspended.
He also said that he was interviewed by national security officials on issues that included his pro-independence views.
Claiming he had been unfairly targeted, Mr McEleny left his post.
Following the preliminary hearing, Frances Eccles said she was persuaded Mr McEleny's support for independence had "a sufficiently similar cogency to a religious belief... to qualify as a philosophical belief".
Under the Equality Act 2010, it could therefore be relied upon as a "protected characteristic" for claiming discrimination.
The judgement said: "The claimant was clear in his evidence that he does not believe in Scottish independence because it will necessarily lead to improved economic and social conditions for people living in Scotland.
"It is a fundamental belief in the right of Scotland to national sovereignty."
A lawyer acting for the MoD had argued that a political belief did not amount to a philosophical belief.
"It does not have a similar status or cogency to a religious belief," it was claimed.
The MoD had further argued that support for Scottish independence did not extend far enough beyond Scotland to warrant the status of a philosophical belief and would have "no substantial impact on the lives of citizens in, for example, Tanzania, Peru or India".
But Ms Eccles found that sovereignty and "self-determination" were "weighty and substantial aspects of human life" and that "how a country should be governed is sufficiently serious to amount to a philosophical belief".
Speaking on behalf of Mr McEleny, lawyer Aamer Anwar said: "This legal precedent now enables my client to pursue a claim for direct discrimination alleging that he was discriminated against because of this belief.
"But whilst this an unprecedented legal landmark, I am conscious that this case has taken up two years of Cllr McEleny's life, it really is time that the UK government launched an inquiry into the alleged treatment rather than forcing him to pursue them through the courts."
A spokesman for the MoD said: "It would be inappropriate to comment on the details of an ongoing employment tribunal."