A bank robber was caught after posting pictures of his car on Facebook.

Gary Timoney parked the Mercedes estate near a private CCTV camera before a thwarted raid on a petrol station hours before he carried out the bank robbery.

Police investigating the attempted robbery at the filling station checked footage and saw Timoney and the Mercedes C Class near the scene.

Detectives found the only car matching its description registered in the Glasgow area belonged to Timoney and further checks showed images of him on Facebook along with pictures of the vehicle.

He returned to the High Court in Edinburgh for sentencing on Wednesday and was handed a four-and-a-half year jail term.

Judge Lord Boyd of Duncansby told him: "Staff and employees in such premises are entitled to the protection of the court from behaviour such as yours."

Timoney, 41, told staff at Balmore Filling Station in Glasgow, to put cash in a bag.

He then exposed the handle of what appeared to be a handgun and repeated the demand for money but a worker pressed a panic alarm prompting him to leave the premises.

About five hours later, Timoney struck again at a branch of the Royal Bank of Scotland in Stonelaw Road, Rutherglen, South Lanarkshire.

He again made demands for money and warned staff: "Don't do anything stupid, don't press any buttons."

Timoney told one of the bank tellers, Jean Currie, 57: "I'm so sorry, it's a desperate time, let me see your hands. Don't do anything silly, It's not worth your life."

He then passed a bag to her colleague Claire Paterson, 30, telling her to fill it and said: "I'm really sorry."

Victims thought the robber sounded sincere when he made his apologies.

Timoney made off with a total of £6296 following the raid on the bank on August 2 last year.

Timoney, of Barmulloch, Glasgow, earlier admitted carrying out the attempted robbery at the filling station and the robbery at the bank branch.

Lord Boyd said he accepted it was an imitation firearm involved in the attempted robbery at the petrol station.

The judge said from testimonials it appeared those who knew him considered the offences to be out of character and they were driven by the build up of a drug debt.

Lord Boyd told Timoney he would have faced a six-year prison sentence but for his guilty pleas.

Defence solicitor advocate Liam O'Donnell said there had been substantial recovery of the money taken from the bank after a large amount was found in a sink.