A workplace parking tax is a step nearer after MSPs voted in favour of the charge during a debate on new transport legislation.

Members of Holyrood's Rural Economy and Connectivity Committee voted by six to five to allow councils to introduce a workplace parking levy, with the SNP and Greens in favour and other parties opposing.

If introduced, the scheme would see employers pay an annual fee to the council for every parking space they provide for workers. Employers could then decide to pass on the cost to their staff.

MSPs in the committee unanimously agreed to have national exemptions for disabled parking spaces, NHS premises and hospices, and to allow councils to create their own further exemptions.

Proposals for national exemptions for a wide range of further workers, including the police, fire, coastguard and lifeboat services as well as teachers and carers were voted down by the Greens and SNP.

Green MSP John Finnie proposed the change to enable local authorities to bring in the tax if the Transport Bill is passed when it comes before the Scottish Parliament for a final vote.

"It is for local authorities to determine if they wish to introduce a workplace parking levy," Mr Finnie said.

"This is a power not a duty and empowers local authorities to act."

Mr Finnie said the charge would be a way to address the climate emergency and councils would require to hold a consultation on introducing the tax.

He criticised proposed changes from opposition parties - including attempts to make local authorities hold a referendum before bringing in the tax, for them to be satisfied they have adequate public transport, and to prevent it from applying to business customers - saying some were attempts to "frustrate" the bill.

The MSP stressed that the charge would not apply to motorists going supermarket shopping and said local authorities could chose exemptions to meet their own needs.

Transport secretary Michael Matheson said national exemptions should be exceptional and those proposed by Labour, the Liberal Democrats and the Tories "will undermine local decision making and make the scheme unworkable and ineffective".

The SNP's Richard Lyle, previously critical of the tax plans, told the committee he has now changed his mind, accusing those in opposition of "scaremongering".

His colleague John Mason said it is a "tax on the elite", arguing only "bosses and company directors" have free city centre parking spaces, not ordinary workers, which Conservative Jamie Green challenged and said people would be "horrified" to hear.

Committee convener, Tory Edward Mountain, said: "I do not support the workplace parking levy and I do not believe it will achieve anything further from the climate's point of view."

He added: "I believe this is a tax on going to work."

Those opposing the plans criticised the tax powers being proposed as a result of the agreement between the minority SNP administration and the Greens to pass the budget earlier in the year, with Labour's Colin Smyth calling it a "murky deal".

Lib Dem Mike Rumbles said: "We are making bad law. I think the SNP and Green budget deal has shackled our work."