An SNP official has resigned after making abusive Twitter comments about Charles Kennedy.
Brian Smith, who was convenor of the SNP's Skye and Lochalsh branch, called the former Liberal Democrat leader a "drunken slob" and "quisling-in-chief".
The tweets were sent before Mr Kennedy's death on 1 June, which was caused by a major haemorrhage linked to his long battle with alcoholism.
Mr Kennedy lost his seat to the SNP's Ian Blackford in last month's election.
Mr Smith, who has now deleted his @lobsterferret Twitter account, is reported to have sent more than 130 messages to Mr Kennedy before and immediately after the vote.
In one, he said: "We have a different target here though with the Quisling-in-Chief LibDem St Charles of Kennedy."
Soon after Mr Kennedy lost his seat in the Ross, Skye and Lochaber constituency, a tweet from Mr Smith described him as a "drunken slob" and said: "Lies smears and deceit didn't work. Bye Bye."
News of Mr Smith's resignation emerged as Mr Kennedy's funeral was due to take place near his Highland home.
An SNP spokesman said: "Mr Smith was spoken to and accepts that his comments during the campaign were entirely inappropriate - as a result, he has resigned as convener of the Skye and Lochalsh branch."
He said Mr Smith had never been been employed by Mr Blackford in any capacity and added: "Today is a day to remember Charles Kennedy with respect and dignity."
Mr Kennedy, who died at the age of 55, was an MP since 1983, and his leadership of the Lib Dems from August 1999 to January 2006 saw the party enjoy its greatest electoral success in 2005, winning 62 seats.
Following his death, tributes for the former party leader poured in from across the political spectrum, with former Lib Dem leader and deputy prime minister Nick Clegg and Prime Minister David Cameron among those expressing their sadness.