According to Hindu epic tradition, Lord Rama returned to Ayodhya after completing 14 years in exile and defeating Ravana, where he celebrated his first Diwali. Ayodhya was illuminated with earthen lamps by its citizens to welcome him back. This event marks the historical and mythological origin of the festival.