Derek Mackay, the local government and planning minister, who has two young sons with wife Jennifer, informed his family several months ago.
The 36-year-old is living apart from his wife and is believed to have begun a new relationship since they separated.
Speaking publicly for the first time about the split, Mr Mackay - who is also chairman of the SNP - appealed for the family's privacy to be respected.
He said: "Having been aware myself for some time and having informed family and friends it is important for me to be clear publicly that I am gay.
"While my wife and I remain on very good terms we have separated.
"While I feel it is important to be open about this change in my personal circumstances I would ask that our privacy is respected while we support our family through this period."
Mr Mackay's wife is not active in politics and the Renfrewshire North and West MSP has kept his family out of the public eye.
The marriage split is said to have been "amicable".
Family members and close personal and political friends have been "incredibly supportive," according to a source close to the minister.
Joe FitzPatrick, the minister for parliamentary business and a friend of Mr Mackay, said: "Derek has taken his time to think about this and he has decided that although this is his private life, it is important to let his constituents know that his circumstances have changed.
"His family has been his first priority throughout and I hope everyone else can respect that.
"Being gay in politics isn't the news story it used to be and it's a welcome sign in Scottish public life that whatever your sexuality, it's your work that matters."
Mr Mackay - who is business convener, or chairman, of the SNP - is seen as a rising star in the party and as a potential future leader.
Elected to Holyrood in 2011, he became a minister following a mini-reshuffle later the same year.
In his role as local government and planning minister he has been at the heart of plans to reform the way councils operate.
He has also signalled a possible relaxation of the rules on mobile phone masts, in a bid to improve Scotland's patchy network coverage, and last week unveiled well-received proposals to increase the number of allotments across the country and give communities greater rights to make use of derelict land.
A rare stumble during his steady rise came last year when, as the Nationalists' campaign co-ordinator in the local government elections, the SNP failed to make hoped-for gains.
He is a former leader of Renfrewshire Council and was Scotland's youngest councillor when he was first elected to the local authority in 1999, aged 21.
According to his official Scottish Government biography he "enjoys reading, running, swimming and time at the gym" in his spare time.
Mr Mackay's determination to speak out reflects changing public attitudes towards homosexuality over the past few decades.
A number of MSPs are openly gay, including Mr FitzPatrick.
Others include the leader of the Scottish Conservatives, Ruth Davidson; Patrick Harvie, the leader of the Scottish Greens: and Jim Eadie, the SNP MSP for Edinburgh Southern who has campaigned for a change in the law to allow same sex marriage.