Four armed robbers forced their way into a flat in Fife and terrorised two young men at gunpoint before making off with cash and valuables.

The balaclava-clad thieves were carrying a handgun, a crowbar and a machete when they burst into the home of Dwayne Kinne, who was with his cousin Nicholas "Ollie" Roberts, shortly before midnight on January 7, 2015.

The two men feared they were going to be shot after the gun was pointed at their heads and another robber threatened to cut off their fingers, the High Court in Edinburgh heard.

Derek Finlay, 31, James Mackie, 30, Gordon Ellis, 24, and Scott Smith, 23, pleaded guilty to armed robbery on Friday.

They stole £2500 and other valuables from the flat in Viceroy Street, Kirkcaldy.

Among the items taken was a mobile phone on which Mr Kinner had installed a tracking app.

He went to Kirkcaldy police office in the early hours of January 8 with a tablet containing a screenshot showing his phone was at a house in Stewart Street, Dysart.

When officers arrived at the address, Finlay was inside. He told them: "There's no a firearm but I've got a phone." They also recovered computers, games, a sound bar and £710.

Mr Kinner, who was 25 at the time, later identified the stolen goods.

The court heard that following the raid Mackie had given a woman a gold watch and asked her to keep it for him. She had thrown it away in a panic but later showed police where she had disposed of it and it was recovered.

The gun, which turned out to be an air pistol, was later found behind a kickboard in a kitchen at a house in Glenrothes which Finlay had frequented. Advocate Ashley Edwards QC said the air pistol looked like a handgun.

Ellis was later detained in Kirkcaldy and admitted his part in the robbery. He said three or four days before it Mackie, who knew he was in debt, had spoken to him.

He said: "Mackie phoned me and said there was a job going if I wanted it."

He added that after the raid they went back to Finlay's house and split the cash.

Police also learnt that following the robbery Smith and Mackie had been boasting that they had just "taxed Ollie".

Smith was later interviewed by police and said: "Four of us went in. I only had a crowbar." He said Mackie had said he had "a job" to do and there would be money in it. He said the victims seemed to be scared.

Mackie, of Denfield Place, Kirkcaldy, Ellis, of Mains Road, Cardenden, in Fife, Finlay, a prisoner, and Smith, of Kirkburn Drive, Cardenden, all pleaded guilty to assault and robbery.

Judge Michael O'Grady QC deferred sentence for reports and all four were remanded in custody.