Cowdenbeath by-election: Alex Rowley holds seat for Labour
Labour has held the Scottish Parliament seat of Cowdenbeath with an increased majority in a by-election sparked by the death of sitting MSP Helen Eadie.
Fife Council leader Alex Rowley beat the SNP to claim the seat with a 5,488 vote majority.
The Conservatives came third, while UKIP pushed the Liberal Democrats into fifth place.
The result saw an 11.25% swing from the SNP to Labour from the 2011 Scottish election, on a voter turnout of 34%.
Mr Rowley said the outcome of the by-election, declared at about 01:00 on Friday, was about more than the Scottish government's 18 September independence referendum.
He said: "It's about full employment for every young person to get the opportunities that they deserve from their lifetime.
"It's about elderly people living in Fife with dignity, and making sure when they need services those services are available.
"We can give people jobs, we can give people opportunities, we can do that with a strong, devolved Scottish Parliament working within the UK."
Labour held Cowdenbeath with a 1,247 vote majority at the last Scottish Parliament election.
The area is represented at Westminster by former prime minister Gordon Brown.
Labour leader Johann Lamont said the by-election result was "significant".
She added: "I believe people in this area have responded to our positive campaign on jobs, education and support for older people - these are the issues they want politicians to be focusing on, and that's what Alex Rowley will be doing as an MSP.
"I think voters are telling Alex Salmond to get on with his day job."
The SNP said its share of the vote was the same as in the 2007 election, adding that Cowdenbeath was the only Fife seat the party did not win in the 2011 polls.
The party's candidate, Natalie McGarry, said: "In eight months' time there is going to be a referendum, and people in this constituency and across Scotland will have a vote.
"I heard on the doorsteps from a lot of traditional Labour voters who said: 'Listen, Natalie, I'm not going to vote for you, but I am actually thinking about voting yes in the referendum'.
"So Alex Rowley may be the victor tonight, but I believe the whole of Scotland will celebrate a Yes victory in September."
Fife councillor Dave Dempsey, who came third for the Conservatives with 1,893 votes, said: "We are going in the right direction. You could not buy the effort, dedication and enthusiasm that I have had at my disposal over the last several weeks. We're getting there."
A Conservative spokesman said it was a "good result" as they were the only party to increase their share of the vote.
Jade Holden, who fought the seat for the Liberal Democrats, added: "I am really proud of the campaign we have run.
"It has been really positive, and we have got our message out there about lower taxes and support for jobs."
UKIP candidate Denise Baykal said of the result: "This shows that UKIP is here, it's here to stay and we are increasing our vote all the time.
"Hopefully this will mirror our success in the European elections."
Ms Eadie, who was being treated for cancer when she died in November last year at the age of 66, had been an MSP since the Scottish Parliament was established, in 1999.
Labour also held on to its Motherwell North seat in a by-election for North Lanarkshire council, the result showing another swing from the SNP to Labour.
Scottish Labour's Pat O'Rourke polled 1,719 first preference votes. The SNP's Jordan Linden was second with 520, followed by the Conservatives with 173 and UKIP with 107.
The 4.7% drop in the SNP vote was smaller than the 13.2% slump at Cowdenbeath.