A black hospital patient in Illinois says he was arrested while on a walk last month after police claimed he was trying to steal the IV that was hooked up to his arm to sell it online.

Shaquille Dukes, 24, claims he was being treated for pneumonia at the Freeport Health Network Memorial Hospital in Freeport on June 9 when he went outside after "receiving doctors orders to walk around."

During his walk, he said he encountered "an overzealous, racist, security officer, who claimed that I 'was trying to leave the hospital to sell the IV equipment on eBay,'" according to a June 17 Facebook post he wrote of the incident.

Dukes said the security guard called the police to the hospital. When they arrived, the officers arrested Dukes's brother, who was with him at the time, before arresting Dukes.

The officers, according to Dukes, said he was "being arrested for attempted theft, of the IV equipment that was clearly attached to my arm." He added, "officers stood by and watched while my IV was removed on the sidewalk, and it was NOT by a doctor."

POLICE THREATEN TO ARREST STARBUCKS CUSTOMER AFTER MISTAKING HER FOR DIFFERENT WOMAN, BODY-CAM FOOTAGE SHOWS

The man alleges that when he told authorities he was being treated for pneumonia and asthma, an officer said to him, "I don't care why you're here, you're going to jail," and proceeded to transport him.

During that time, Dukes claims the officers took his inhaler and that he suffered a seizure and an asthma attack. He said he "pleaded with officers for almost 4 minutes to retrieve my inhaler" before he became unresponsive, eventually getting his inhaler.

But the Freeport Police Department said a different series of events unfolded on June 9. In a news release posted June 18, the department said an officer was requested by a security guard to the scene, and three people were arrested and charged with disorderly conduct after a verbal dispute with the security guard.

"Several social media posts have since been created which contain inaccurate information regarding the incident and departmental response. In one of the social media posts, an individual wrote 'officers stood by and watched while my IV was removed on the sidewalk, and it was NOT by a doctor,'" police wrote. "This statement is misleading, as the IV was removed at the request of the subject by FHN medical personnel (not security or police)."

The police department told ABC News that per their investigation, "at no time did any doctor or nurse give that patient or any patient permission to leave the hospital while still hooked to an IV machine."

"It was determined that he was likely not trying to steal any of the property," Freeport Police Chief Todd Barkalow told the news outlet. "But the charges were supported for disorderly conduct with their actions toward the security guard."

CLICK HERE TO GET THE FOX NEWS APP

Dukes, his brother and a third person were arrested and charged with misdemeanor disorderly conduct. Two of those involved were also charged with misdemeanor resisting or obstructing a peace officer, police said.

Dukes said he's filed a complaint with the city, and according to his Facebook post, is working with an attorney.