Robert Gruszka assaulted compatriot Robert Dudek, hitting him on the head with a bottle in a bag after a drink was lost.
The 43-year-old's body was found next to a car park at Edinburgh Royal Infirmary in April this year.
Gruszka was yesterday jailed for five years and three months at the High Court in Edinburgh after he pled guilty to culpable homicide.
Judge Lord Turnbull told him: "You perpetrated an act of violence which caused the death of your friend."
Gruszka had been a prisoner in his homeland.
The victim had gone with friends to Saughton prison on April 5 to meet Gruszka who was being released from a jail sentence for shoplifting. They had gone drinking before boarding the wrong bus and being ordered off after the group tried to fare dodge.
Gruszka, 38, was originally charged with murdering Mr Dudek.
Lord Turnbull added: "The only way in which the court can mark the gravity of an offence such as this is by imposing a custodial sentence."
But the judge added there were unusual aspects to the crime and to the circumstances in which it occurred.
He said: "It is, to my mind, important to note that you and the others present were a group of friends. There was no animosity between you, nor any other incidents of argument. I accept that the manner of the assault can best be described as a reckless and impulsive act, rather than a calculated or premeditated act."
Detective Chief Inspector David McLaren, who led the investigation, said: "While nothing can undo the pain caused to Robert Dudek's family, Gruska's earlier guilty plea to culpable homicide has spared them the ordeal of a full trial."