James McKenzie, 21, struck one victim five times with a blade as he attempted to grab his phone and backpack on a cycle path in the city’s Warriston area. He left the victim, Matthew James, with a laceration to his lung and two broken ribs following the stabbing in October 2018.
McKenzie stabbed another man, Szymon Pasterski, in the abdomen the day before as they walked past each other at Coalhill near the Water of Leith.
Edinburgh Sheriff Court heard that he was drugged up on Valium during the attacks.
McKenzie previously admitted both attacks and was remanded in custody before appearing on Tuesday for sentencing.
But the violent offender was allowed to walk free after Sheriff Nigel Ross was persuaded to spare him a custodial sentence and instead give him a community payback order to complete 250 hours of unpaid work.
He was also placed on a restriction of liberty order for the next eight months and will be electronically tagged and will have to stay home between 8pm and 6am.
Lothian MSP Miles Briggs (Scotttish Conservatives) said: "It should go without saying that Edinburgh residents should be able to walk freely around our city without fearing for their personal safety."
"That unprovoked attacks, which resulted in broken ribs and stab wounds and to which the assailant pleaded guilty on both counts, did not result in a custodial sentence is deeply concerning.
"Yet again this looks like an SNP government that's soft on violent crime and which is not doing enough to make sure there is adequate capacity for violent offenders to be behind bars."
Scottish Conservative shadow justice secretary, Jamie Greene, said: “This is an appalling example of the SNP’s soft-touch justice attitude.
“This individual is clearly a dangerous criminal and it will strike most people as shocking that he has avoided a jail sentence despite pleading guilty to such a violent attack.
“Time and time again, the SNP fail to stand up for the victims of crime or set any sort of example in how violent crime is punishable.
“The Scottish Conservatives will continue to push for a Victims Law to be introduced as soon as possible to ensure that victims, not perpetrators, sit at the heart of our justice system.”
The Scottish Government has been contacted for comment.
Previously, Edinburgh Sheriff Court was told both victims were completely unknown to McKenzie before he attacked them.
Fiscal depute Jennifer McLaren said Mr James was walking along the cycle path at Warriston at around 7pm on October 8, 2018, when he noticed two males walking towards him.
Ms McLaren said: “As the complainer approached the two males Mr McKenzie stopped in front of Mr James and bumped chests causing him to stop.
“He said ‘gonna give me your phone mate’. Mr James refused and was pushed in the chest and he staggered backwards.
“Mr McKenzie took hold of his backpack and pulled him round. Mr James felt a pain in his left side and thought he’d been punched.”
The fiscal added the victim also felt a pain in his back and arm before he then “felt something cold next to his jaw” as McKenzie held the blade to his face.
A witness saw the attack and shouted at McKenzie, of Marine Drive, Edinburgh, and his accomplice to stop and both assailants soon “walked off in a different direction”.
An ambulance was called and the witness helped Mr James stem the flow of blood by taking off his t-shirt and administering first aid.
The court heard Mr James suffered five knife wounds to his stomach, back and arms as well as two broken ribs and a lacerated lung.
Police launched a man hunt for the attackers and McKenzie was identified and arrested the following week.
Defence lawyer Jim Stephenson said his client had “little recollection of events” due to taking Valium tablets beforehand and had suffered a traumatic childhood.
McKenzie pleaded guilty to assaulting Szymon Pasterski by striking him to the body with a knife or a bladed implement to his severe injury and permanent disfigurement at Coalhill, Edinburgh, on October 7, 2018.
He also pled guilty to assaulting Matthew James by demanding his belongings and striking him to the body with a knife or bladed implement and placed the blade to his face all to his severe injury, permanent disfigurement and danger to life and attempt to rob him of a phone and bag at a cycle path near Connaught Place, Edinburgh, on October 8, 2018.