A man attacked three paramedics who rushed to help him after he was found slumped in the street.
Andrew Delaney punched, kicked, and spat at the medics and tried to urinate in the back of their ambulance. One of the emergency crew was left with a suspected fractured wrist.
The 39-year-old then made a series of lurid threats to kill police officers while causing a disturbance in hospital after being taken to A&E. He has now been locked up.
Swansea Magistrates' Court heard the incidents took place on the afternoon of February 2 this year.
Carmel Cockings, prosecuting, said paramedics responded to calls from the public about a man collapsed and unresponsive in Old Road in Neath.
The first to arrive on the scene in Melin was a female medic in a rapid response vehicle who initially began to tend to the man. Shortly afterwards an ambulance arrived with a male and female paramedic aboard.
The prosecutor said Delaney was put in the back of the ambulance but began shouting and waving his arms around. He then announced to was was going to urinate and began to remove his trousers. When the paramedics tried to stop him he began to lash out.
The defendant started punching out, catching the female paramedics in the face, as well as kicking, spitting, and shouting as the emergency workers tried to deal with him.
Eventually he was removed from the ambulance and continued to be aggressive until members of the public and police officers who had been summoned to the scene managed to restrain him on the ground.
Miss Cockings said Delaney was subsequently taken to Morriston Hospital where he caused a disturbance in the A&E department as he threatened to stab two police officers and "smash their faces".
The paramedics suffered bruising and swelling as a result of the assaults and one of the female medics sustained a suspected fracture to her wrist.
In a letter to the court the chief executive of the Welsh Ambulance Service outlined the impact the incident had had on the paramedics and the knock-on effect on the public of them being off work and noted physical assaults on frontline staff had increased by 29% between 2017 and 2018.
Delaney, of Heol Elfed, Llanelli, had previously pleaded guilty to three counts of assaulting an emergency worker and two public order offences, in relation to the incident in hospital, when he appeared via videolink for sentencing. The court heard he has 35 previous convictions for 122 offences, including two for assaulting police officers.
Simon Howell, for Delaney, said the defendant was disgusted by what he had done on the day in question. He said his client had been out of prison for some 12 months before the incident – a relatively long period given his history – but on February 2 he had consumed drugs and alcohol as a way of dealing with the 10th anniversary of his brother's death.
The solicitor said Delaney "bitterly regrets" what he did to the paramedics and police officers and wished to apologise to them.
Delaney was jailed for 48 weeks and ordered to pay each paramedic £150 compensation.