It was necessary to elect a new councillor after the previous incumbent, Corri Wilson, was elected as MP for Ayr, Carrick and Cumnock in the UK general election earlier this year.

The new councillor was elected using the single transferable vote (STV) voting system, and was elected at stage 4 of the count, after achieving the highest number of votes when only two candidates remained.

Turnout was 34.4 per cent, with 4,006 votes cast out of an electorate of 11,638 — 36 ballot papers were invalid.

Total number of first preference votes for each candidate were — Dan McCroskie (Scottish Conservative) 1527, John Wallace (SNP) 1507, Susan Wilson (Scottish Labour Party) 642, Andrew Bryden (Independent) 218, and Boyd Murdoch (Green Party) 76.

As no candidate had attained the quota required to be elected, 1,986, the candidate with the lowest number of votes, Boyd Murdoch, was eliminated, and his votes transferred to the remaining candidates in accordance with voters’ next preferences.

This procedure continued until there were only two candidates left with Mr Wallace having more votes than Mr McCroskie.

Members of the Ayr East branch of the SNP took to social media the day after the election.

One such message read: “Congratulations to our newest councillor, John Wallace, on holding Ayr East for the SNP. Now we need to work towards a strong showing in the Holyrood elections on May 5, 2016.” Mr Wallace said: “I am honoured to have been elected to represent the people of Ayr East on South Ayrshire council and would like to thank all of those people who turned out yesterday to vote for me.

“I will work tirelessly for my constituents – however they voted yesterday – to deliver a better future for their families and for people across South Ayrshire.” SNP business convenor Derek MacKay, added: “I congratulate Councillor John Wallace on a fantastic win where the SNP has taken votes from every other party with a swing of almost seven per cent away from Labour.

“That this by-election is in a ward where the Conservatives topped the poll in 2012 and in one of the few remaining Tory constituencies in the Scottish Parliament shows that the Tories remain as toxic in Scotland as they ever were.

“This by-election is further confirmation that after eight years in government people continue to place their trust in the SNP to represent their communities and to deliver for Scotland. We take nothing for granted — we will work hard to retain the trust of the Scottish people next year and gain an historic third term in government.” South Ayrshire Council is made up of 10 Conservative councillors, nine each SNP and Labour, and two independent.