The Scottish government has confirmed it will introduce a bill within the month to allow same-sex marriage.
Ministers promised to change the law, but also to protect the rights of religious groups who do not want to carry out such ceremonies.
The Church of Scotland and Roman Catholic Church are against the plans.
Once the legislative proposal is lodged at parliament it will undergo scrutiny before committee members and in the chamber.
Alex Neil told MSPs that the bill would be introduced in the current parliamentary sessions.
Talks have been taking place with the UK Government because ministers at Holyrood believe an amendment is needed to UK equalities legislation to protect individual celebrants who may not want to conduct same-sex ceremonies even if their church, as an organisation, backs them.
Health secretary Mr Neil said "substantial progress" had been made on the issue in discussions with UK Culture Secretary Maria Miller.
The UK government's plans to legalise gay marriage cleared the House of Commons last week.
Labour's Drew Smith asked Mr Neil when gay couples in Scotland would be able to get married, and if he thought the first weddings "would take place before or after the September 2014 referendum".
Mr Neil said: "I'm not thinking in terms of a referendum, rather the principles of the bill. Obviously we have given a commitment to introduce this legislation after the extensive consultation we have had as quickly as possible, which is what we're doing. I would hope the timetabling would be such that we could see this bill become law sooner rather than later."