Alex Salmond has become the first ever nationalist to lead Scotland’s devolved government after out Green MSP Patrick Harvie and party colleague Robin Harper voted him into office.

The Scottish National Party beat Labour to first place in the last week’s elections for the Scottish Parliament, but with 47 seats do not have an outright majority in the 129-member parliament.

A possible coalition between the Lib Dems, who have 16 seats, and the SNP foundered over the issue of a referendum on independence.

Mr Salmond was elected as First Minister by 49 votes to 46. The Tories and Lib Dems abstained from the vote.

The Nationalists will now run the first minority government since Scotland’s parliament was re-established in 1999.

“I believe Scotland is ready for change, ready for reform,” Mr Salmond told MSPs.

“We’re a small nation but we’ve got a big future. In this century there are limits to what governments can achieve. But one thing any government I lead will never lack is ambition for Scotland.”

The Greens will back the SNP government’s budget and the appointment of Mr Salmond and then decide to support other policies on a case-by-case basis.

A Green MSP will be appointed as the convener of one of the Parliament’s select committees.

Patrick Harvie, who is bisexual, faced challenges from fundamentalist Christians during his re-election campaign.

After the vote he told PinkNews.co.uk about some of the slurs and abuse levelled at him during the election:

“I am very pleased that we held onto the seat despite a vicious homophobic campaign, including allegations that I have been distributing pornography to children.

“I will not be letting these allegations lie.”

He thanked the many people who had written to express their disgust at the tactics of his opponents.

Two other out politicians were re-elected to the Scottish Parliament.

Iain Smith held on to Fife North East for the Liberal Democrats with a 15.9% majority.

Lesbian MSP Margaret Smith retained Edinburgh West, also for the Lib Dems, with a majority of 16.9%.