The former employee of First Minister Alex Salmond, who is now 21, was handed a 160-hour community payback order as a direct alternative to prison.

He had admitted running up three times the permitted amount of expenditure during his successful 2012 campaign.

Inverness Sheriff Court heard that MacLeod altered invoices and failed to submit others between March 22 and May 2, 2012, to ensure he fell below the £1226 expenses threshold.

He will now be barred from a political career as well as a legal. He had been accepted to study to become a lawyer.

Sheriff Andrew Miller told him: “Limits on expenditure are intended to ensure fairness in the electoral process and the court must take a serious view of your actions in knowingly and fraudulently failing to reveal the true extent of your expenses and fraudulently altering invoices.

“Your unacceptable conduct has had significant consequences for your ambitions to pursue political office as well as in your personal life. You have let your electorate down.”

Afterwards MacLeod said: “I am looking forward to the opportunity to repay the significant debt I owe to society and offer my constituents closure. This was a crime against the public and the sentence of doing work for the public fits the crime.”

Remorse

He had faced a maximum six month jail sentence but the sheriff imposed the community payback order as an alternative to custody because of his genuine remorse.

Fiscal depute Amanda Mitchell said police had received an anonymous letter in July, 2012 querying his election expenses.

They investigated and discovered that he had run up bills of three times the permitted amount, totalling £3796.28p.

Of his bigger bills, MacLeod had spent £1379 with a Caithness print company on flyers, posters and a maildrop but had only declared £260.

He had also spent £930 on advertising and other services from North of Scotland Newspapers and only declared £738. An invoice had also been altered to show £192 less than the actual amount.

The court heard that bill had not been paid, although his defence agent Duncan Henderson said his client is currently paying it off in £100 instalments.

Mr Henderson said: “ My client has always intended to plead guilty and no companies will lose out as a result of this.

“In 25 years of legal work, I have never come across a case like this. He completely accepts he fraudulently altered invoices and has since resigned from the Council and the SNP.

“In his enthusiasm for politics, he embarked on a fairly amateurish scheme which the police had no difficulty in detecting.

“His remorse is genuine and he accepts he has let his electorate down. He will pay a high price because he will not be allowed to continue in politics and will be barred from other walks of life, as he had been accepted to study as a lawyer.

“He accepts the integrity of the electoral process must be preserved and that he stepped outside his and his family’s moral code.”

Successor

Ironically, Macleod’s successor is a former policeman, Matthew Reiss, who was the head of the Caithness and Sutherland Area Command of Northern Constabulary.

When MacLeod resigned he said he had to be “honest about any mistakes that I have made”, adding: “I got into this situation when I was very young, with all the arrogance and hot-headedness that that entails.

MacLeod was the Highlands’ youngest councillor, having been elected as a 19-year-old. He was the youngest in Scotland to be elected in 2012.

He stood down as an SNP Party member when the allegations arose.

He was Gaelic spokesman for the SNP-led administration, but has resigned from the controlling group on the local authority while there are legal proceedings against him.

A police probe was launched when a complaint was made to the force by an unnamed individual about his conduct during the election campaign.

MacLeod was born and raised in Tain, Ross-shire, and was taught through Gaelic at Tain Royal Academy. He left school early and worked for 10 months for First Minister Alex Salmond.

He subsequently studied Law at Edinburgh University and was also very active in the Young Scots for Independence organisation, rising to the position of National Secretary.

In 2010 he was appointed as Parliamentary Assistant to the SNP MSP Rob Gibson and was his Campaign Manager in the 2011 election when Gibson captured the Caithness, Sutherland and Ross seat from the Lib-Dems.

He has enjoyed a high profile on the authority since his election victory, declaring the council would “not know what hit it” once he started work.

The councillor was a vocal supporter for the lifting of the ban on same-sex marriage, saying: “I look forward to making full use of this new law – maybe a wee bit later in life.”

Spending limits are imposed on election candidates so that wealthy individuals cannot lavish huge amounts of cash on winning by splashing out on heavy advertising or sponsorship.