Colonel Senussi Kaiba was killed along with his driver when gunmen opened fire at their car in a residential area of the city, the source said.
Security services were placed on high alert and a manhunt launched for the assailants who fled after the attack, the source added.
Two days earlier a local administration official escaped unhurt after gunmen opened fire at him in a similar attack.
Sirte is in the hands of Islamist militias, including Ansar al-Sharia, which the UN added to its terror list in November over links to al-Qaeda and for running camps for the Islamic State jihadist group.
More than three years since Gaddafi was ousted and killed in a NATO-backed uprising, oil-rich Libya is awash with weapons and has two rival governments and powerful militias battling for territory.
Fajr Libya declared a ceasefire last week after an agreement at a meeting in Geneva on a roadmap to form a unity government.