A man who accused Muslims of being behind the Glasgow bin lorry crash has avoided jail.

Robert Rankin, 52, mistakenly believed terrorists were behind the tragedy on December 22, 2014, and posted a tweet attacking Islam on the social media site that day.

He pleaded guilty to threatening and abusive behaviour over the tweets and had faced up to a year in prison.

On Tuesday, Rankin, who Paisley Sheriff court heard was on benefits, was ordered to pay a fine instead.

A total of six people died and 15 were injured in the bin lorry tragedy, which took place after driver Harry Clarke blacked out at the wheel as he travelled towards George Square.

Rankin made several offensive remarks about Muslims between December 2014 and January 2015. He also posted sectarian comments and ranted about Israel, Yemen, Iraq, Iran, Syria, the English town of Stockport and the London borough of Tower Hamlets.

He was due to go on trial but admitted his guilt after his lawyer, solicitor advocate Robert Kerr, struck a deal with prosecutors which led to three other charges against his client dropped.

Rankin admitted behaving in a threatening or abusive way by posting offensive comments about Islam on Twitter on December 22, 2014, and posting further anti-Muslim tweets on January 12, 2015.

Mr Kerr said Rankin was a regular user of Twitter and on the day of the crash he had family in Glasgow city centre who he was concerned about.

The lawyer said: "He behaved badly and it's fair to say he'd been watching things about terrorism on the TV.

"He had been seeing on a daily basis, in the newspapers, the news and the press, what was going on and on this occasion thought there was an association.

"His relatives were in Glasgow city centre at that time and that's what prompted this."

Sheriff Simon Fraser fined Rankin £450 and said: "This is pretty unpleasant stuff and if you repeat this you'll find yourself going to prison sooner or later."