Image copyright Getty Images Image caption The patient was being treated for pneumonia (file photo)

US police are investigating the arrest of a black patient in Illinois who was detained near a hospital while attached to an intravenous (IV) machine.

Shaquille Dukes says he went for a walk on his doctor's orders, but was held after a white security guard accused him of trying to steal the machine.

Mr Dukes has now filed a complaint alleging racial profiling.

Freeport police say their officers acted "the best way they could", but have launched an independent probe.

Freeport Health Network (FHN) Memorial Hospital has not commented on the incident, calling it a police matter.

The incident took place on 9 June, and gained national press coverage on Monday after it was picked up by US broadcasters.

On Monday, Freeport police told US media that an external investigator would assess whether officers handled the arrest appropriately.

What does Shaquille Dukes say?

The 24-year-old from Chicago says he was admitted to the hospital with double pneumonia while on holiday.

He says in a Facebook post that "after receiving doctors orders to walk around, I was stopped by an overzealous, racist, security officer, who claimed that I 'was trying to leave the hospital to sell the IV equipment on eBay.'"

He says the police were then called and arrested him for attempted theft.

Mr Dukes says his IV was removed - "not by a doctor" - as police officers stood by.

"They [the police] took my rescue inhaler and began to transport me to the city lockup, while in transit I began to have a seizure, and subsequently an asthma attack, I pleaded with officers for almost four minutes to retrieve my inhaler from the transporting officer, and finally, when I became unresponsive, it miraculously appeared."

What did the police say?

In a statement posted on Facebook, Freeport Police urged "the public to reserve judgment while a complete review of the incident is performed".

It added that the IV was removed "at the request of the subject by FHN medical personnel (not security or police)".

Police chief Todd Barkalow told ABC News that it had been determined that Mr Dukes "was likely not trying to steal any of the property", but he and two other men were arrested "for disorderly conduct" towards the security guard.

The police have shared police body camera footage which they say shows officers "handled it in the best way they could... given the situation that they had in front of them".

Officials also told ABC News that Mr Dukes had not been given permission "to leave the hospital while still hooked to an IV machine".

Mr Dukes is due to appear in court next month, US media reports say.