A bungling armed robber and the accomplice he accidentally shot in the leg have been jailed.

Peter McMurray, 25, and Keith Smith, 30, were sentenced at Glasgow High Court on Wednesday, having pleaded guilty to their role in the incident in Leith, Edinburgh, in August.

McMurray was jailed for seven years and eight months, while Smith received six years and eight months.

The pair had earlier admitted trying to rob Ekundayo Badamas on Cables Wynd on August 26.

They knocked on Mr Badamas' door and confronted him, with McMurray holding a knife.

A struggle broke out and the victim was struck with the blade.

Smith then took a rifle from a bag he was carrying and fired once, unwittingly shooting McMurray in the leg.

Mr Badamas managed to force the men out of the house.

Police officers later discovered McMurray lying on the ground and suffering from a serious leg injury.

He was transferred to Edinburgh Royal Infirmary for medical attention and was later charged by police.

Smith was later traced and arrested as part of an extensive investigation led by detectives from Leith CID.

Detective inspector Alan O'Brien said: "The reckless actions of these men endangered lives and could have easily ended in tragic consequences.

"However, following a swift and effective investigation we successfully recovered the weapon as well as those involved and ensured they could not pose any further risk to the public.

"Incidents involving firearms remain extremely rare in Edinburgh, but the public can be reassured that whenever such incidents do occur we will investigate thoroughly and bring anyone found to be responsible to justice.

"If you wish to report a crime in your area please call police on 101. Alternatively an anonymous report can be made through the charity Crimestoppers on 0800 555 111."