A drug dealer booked a room at a popular hotel for his suppliers when they came to deliver his stash of heroin and cocaine.
Mustafa Al Khafaji was arrested two days after meeting the visitors following a chase with police while the people who supplied him have not been identified.
Tom Scapens, prosecuting, said the police already had intelligence suggesting the vehicle was linked to drug dealing and, when officers saw two known user getting into it, they moved in.
The driver, 37-year-old Al Khafaji, got out of the car and ran off so the officers chased after him and "took him to the ground". When police searched his car they found a dozen wraps of heroin and cocaine.
The two men police had seen getting into the car told police they knew the driver as "Stafa" and had gone to the vehicle to buy drugs from him.
Mr Scapens said the police investigation revealed Al Khafaji had recently hired the car and he had booked a room at Swansea's Ibis hotel for the night of June 30.
It emerged two men had stayed in the room on the night in question and then the following day had met Al Khafaji in his Hyundai in a secluded corner of the hotel car park.
The prosecutor said police believe the two men in the hotel room were not from the local area and had come to Swansea to hand over a supply of drugs to the defendant.
Al Khafaji, of Mayals Avenue, Mayals, Swansea , pleaded guilty to possession of heroin and cocaine with intent to supply when he appeared in the dock. He had previously pleaded guilty to possession of heroin and cocaine.
The court heard he has eight convictions for 18 offences including one from 2014 when he was sentenced to 28 months in prison at Swansea Crown Court for being concerned in the supply of heroin and cocaine.
Ian Ibrahim, for Al Khafaji, said the defendant acted as the main carer for his parents who are both in their 70s.
He said his client had been a heroin user since his school days after trying the drug because of peer pressure and his life had been on a "downward spiral" since then.
The barrister said Al Khafaji was addicted to both heroin and cocaine and while he would have consumed some of the drugs he was caught with it was accepted he would also have dealt some.
He added: "He needs to make some serious decisions about where his life is going."
Judge Christopher Vosper QC jailed him for five years. Al Khafaji will serve half of the sentence in custody before being released on licence to serve the remainder in the community.