The court heard that 22-year-old victim had a congenital defect leaving him with an abnormally thin skull. He died from brain injuries caused by his head hitting the ground.
The single fatal blow was struck after a row broke out between two groups of young men who had been out in the nearby Barcode night club.
Patrick Marrinan, prosecuting, described the row as a "senseless and alcohol fuelled altercation".
Judge Martin Nolan said this was a tragic case where a young man died for no apparent reason. He said he thought O'Reilly was a "young man of conscience" who did his best to tell gardai what happened.
Detective Sergeant Fionnuala Olohan said that after leaving the club Mr Walsh, who was from Castleknock, and two friends met two girls who were part of a separate group of friends from the city.
They spoke to the girls and an argument broke out between them and the boyfriend of one girl, Stephen Keogh. This became physical and spilled out on to the street. CCTV footage showed the two sisters, Danielle and Tammy Fagan, swinging their shoes at Mr Walsh.
She said O'Reilly, who was walking behind the groups, took off his T-shirt and chased Mr Walsh's friend, Glen Ludgate, but Mr Ludgate got away.
O'Reilly then chased the deceased and struck him from behind with a single forceful blow which knocked him to the ground. His head struck the ground with force.
Mr Walsh was taken to the Mater hospital where a CT scan revealed multiple skull fractures and significant bleeding in the brain. He was transferred to the Beaumont Hospital but despite surgery he was pronounced dead two days later.
O'Reilly was sentenced to six years in jail, with the last two-and-a-half suspended.