Knife-wielding robber Colin Lindsay was out on bail
An armed intruder left a man fearing for his life after he burst into his home and attacked him and his flatmate in a hunt for money, a court has heard.
Colin Lindsay brandished a knife as he robbed him shouting: "Where's the money?" and swearing at them.
Lindsay admitted carrying out a racially aggravated assault and robbery while freed on bail on 1 January 2015.
The 20-year-old, from Edinburgh, was remanded in custody ahead of sentencing next month.
The High Court in Edinburgh heard that during the offence he repeatedly punched and kicked Pawel Szucio and robbed him of his wallet and mobile phone after forcing entry.
He also brandished a knife at Mateusz Balawender, robbing him of a phone, laptop, rucksack and bike after abusing the men for being Polish.
The judge pointed out that unemployed Lindsay had an "atrocious" criminal record for someone of his age.
Lord Uist said his last sentence was for committing an assault and robbery while on bail and he has also previously been detained for assault to severe injury.
Advocate depute David Taylor said the victims were in their respective bedrooms at their home in Niddrie House Park when they heard "a large bang on the flat door".
Mr Szucio opened his bedroom door and saw Lindsay walking along the hall and that he was armed with what appeared to be a kitchen knife.
"He immediately recognised the male as a local whom he knows as Coco," said the prosecutor.
Lindsay walked up to him and punched him on the face, knocking him to the ground, before kicking and stamping on his head. He then went into the victim's bedroom and took his phone and wallet.
Mr Balawender was still in bed when he heard shouting and the sounds of an assault. Lindsay ran into his room still brandishing the knife and asked for his phone and bike.
He handed over the phone and a computer which Lindsay then demanded that the victim put in his own rucksack.
Mr Balawender went into the hall and found his flatmate covered in blood. He ran to a friend's home to contact the police.
Officers who arrived at the scene found Mr Szucio covered in blood from facial injuries. He was taken to hospital for treatment and had stitches put in an injury inside his lip and was found to have a broken nose.
Mr Taylor said: "The first victim stated that he feared for his life in the course of the incident."
The prosecutor said that property worth more than £1,000 was taken in the raid and none of it has been recovered.
Lord Uist told Lindsay that he had to consider imposing an extended sentence in his case, involving a period of custody and further supervision.