Khamis commanded an elite military brigade and his death marked the highest-profile pro-Gaddafi casualty since the uprising began that ended Gaddafi's 42 years in power.
Arrai television announced Khamis's death, along with that of his cousin Mohammed Abdullah al-Senussi, son of Gaddafi's wanted intelligence chief Abdullah al-Senussi, saying they were killed during a battle with National Transitional Council (NTC) forces in the city of Tarhouna, 90 km (60 miles) southeast of Tripoli.
The TV station, which has broadcast audio messages from Gaddafi and his spokesman since the Libyan capital was overrun by NTC forces in August, posted pictures of Khamis and Senussi and broadcast verses of the Koran, the traditional way of mourning.
It said Khamis and Senussi died "while confronting the enemies of their homeland" on August 29.
NTC military officials had said in August that Khamis was killed in Tarhouna and buried in the city of Bani Walid but there was no confirmation at the time from Gaddafi loyalists.
Khamis had been reported dead twice before during the uprising, only to reappear.
A U.S. official, speaking on condition of anonymity, told Reuters the United States could not yet independently confirm Khamis's death but said similar information was being received in Washington from "reliable sources."