In Uttara-puraana written by Acharya GunBhadra (7th or 8th century) it is mentioned that in the month of Kartika, krashna paksha, svati nakshatra and on the
night of the 14th (dawn of the amavasya), lord. Mahavira became a Siddha (attained nirvana). An ancient mention of Lord Mahavira's nirvana and lightening of lamps occurs in Kalpasutra of BhadraBahu, v. 123, "When Lord
Mahavira came to Madhyam Pava for his last varshavas, it was the fourth month of the rainy season, seventh paksha, and
krashna of kartik. It was then the last day of krashna of kartik.That night Lord Mahavira attained nirvana." Kalpasutra mentions that due to the
presense of gods, the night was illuminated. It further says "that On the amavasya
night, 16 gana-kings, 9 Malla and 9 Lichchhavi, of Kasi and Kosal, illuminted their doors. They said: "The light of knowledge is gone, we will make light of ordinary matter".
Bhagavan Mahavira discarded the body and the bondage of all Karmas on
that night of Diwali, at Pavapuri and attained Mukti or deliverance. Thus we have been celebrating Diwali with lights since the nirvana of Lord Mahavira.