A dad-to-be assaulted a new father outside a hospital maternity unit, a court heard.
Liam Kelly had stepped in to intervene as Karl Clayton rowed with his pregnant partner at Dewsbury and District Hospital.
Mr Kelly was punched in the face and was initially feared to have broken his nose, Kirklees Magistrates’ Court heard.
He pleaded guilty to charges of assault and using racially-aggravated threatening behaviour.
Alex Bozman, prosecuting, said that the attack happened at 9.30pm on September 6.
Mr Kelly, whose girlfriend had given birth earlier in the day, was outside the hospital having a cigarette when he was joined by Clayton.
He believed that Clayton was drunk but had no problems with him and they headed into the hospital lift together.
About 20 minutes later Mr Kelly went outside again to collect a takeaway and came across Clayton.
M Bozman said: “He was arguing with a pregnant female and shouting and swearing.
“The argument continued, the midwife was alerted, and suddenly the defendant punched Mr Kelly to the right side of his head.
“Mr Kelly fell back into the building and Clayton went to hit him further but members of security staff intervened.
Magistrates heard that Mr Kelly was feared to have broken his nose but this was not established as he failed to attend a follow-up appointment.
During the row Clayton was heard making a racist remark to one of the police officers called to arrest him, who was of Asian ethnicity.
Mr Bozman added: “This was carried out in a loud, aggressive tone in the vicinity of the maternity ward where pregnant and new mothers have heard it.”
Magistrates were told that 27-year-old Clayton was drunk at the time, having consumed a small bottle of whisky.
He drank this after discovering that his partner had gone into hospital earlier than expected, panicking as his two previous children had been premature and suffered complications at birth.
Clayton, who started drinking aged 14, said he could not recall much of what happened but accepted that he had behaved appallingly.
Magistrates sentenced Clayton to 12 weeks in custody, suspended for two years.
He was ordered to complete nine months of alcohol treatment as well as 10 days of rehabilitation activities and 180 hours of unpaid work.
Clayton, of Airedale Crescent in Bradford, must pay Mr Kelly £80 compensation as well as £85 court costs and £120 victim surcharge.