CHICAGO—The star witness in a case focusing on the 2008 Mumbai terror attacks admitted Tuesday to a history of mental illness and to lying to judges and law-enforcement officers, as well as his wife.

David Coleman Headley, who has pleaded guilty to 12 charges related to the attack, which killed more than 160 people, told a federal jury he continued to lie to the FBI even though he knew the government could rescind the plea agreement that had saved him from the death penalty.

Mr....