The passenger hauled off a United flight is a lung doctor with a taste for gambling, a history of angry outbursts — and a conviction for trading narcotics prescriptions and cash for gay sex in motels.

Dr. David Dao of Elizabethtown, Ky., confirmed Tuesday that he was the inadvertent star of a viral video stirring outrage around the globe and said he was undergoing hospital treatment in Chicago.

In an interview from his bed, Dao, 69, told Louisville TV station WLKY that he wasn’t feeling well.

When asked what hurt, the married grandfather from Vietnam answered, “Everything,” the station reported.

His lawyers later released a statement saying Dao’s family “wants the world to know that they are very appreciative of the outpouring of prayers, concern and support they have received.

“Currently, they are focused only on Dr. Dao’s medical care and treatment,” the statement added.

Dao’s own medical license was suspended in 2003 following his arrest on charges including unlawful prescribing and trafficking in a controlled substance.

He was accused of providing prescriptions for Vicodin and other narcotics to a former patient he later hired as his office manager, who was identified in news reports at the time as Brian Case.

The men repeatedly hooked up in motels, with Dao paying Case around $200 each time and also sharing in the drugs, according to a 130-page file compiled by the Kentucky Board of Medical Licensure.

On the day he was busted, Dao was secretly videotaped with Case in a Red Carpet Inn in Jefferson County, Ky., “with his shirt off and his pants undone,” the records say.

Dao was convicted after a trial and sentenced to five years’ probation after the judge agreed to suspend a prison term of two-plus years recommended by the jury.

He agreed to surrender his medical license in 2005, but had it provisionally reinstated in 2015 so he could work one day a week for another doctor in Elizabethtown.

The licensing records also reveal how Dao was “the subject of many complaints” while working at Hardin Memorial Hospital.

The Medical Executive Committee there “took a strong stance in 2002, and put [Dao] on a corrective action plan due to his disruptive behavior” and referred him “for evaluation and anger management,” the papers say.

Since 2006, he’s won nearly $235,000 playing tournament poker, taking home $1,191 in one January contest, according to the World Series of Poker website.

With Post wires