The death of a cabbie who had a heart attack while being detained by taxi inspectors has been ruled a homicide, officials said.

Sources say driver Louis Mauro Machado, 61, had just dropped off several passengers at JFK Airport on Thursday evening when he was stopped by inspectors from the Taxi and Limousine Commission because he did not have TLC plates. Machado was using his own vehicle.

The inspectors asked Machado for his license and registration, but he began arguing with them and pushed one, sources said.

They arrested and cuffed him, and he began seizing, sources said.

The officers uncuffed him and called 911, according to a TLC spokesman. Machado died shortly after at Jamaica Hospital from a heart attack.

A spokeswoman for the medical examiner said the death was ruled a homicide because it happened during a physical altercation. She said this does not necessarily mean the death is criminal.

The Queens District Attorney is aware of the incident but wouldn’t comment on whether their office is conducting an investigation.