Bhagwan Mahavira attained keval-gyan
It was an Upasarg (उपसर्ग) and it happened after Bhagwan Mahavira attained keval-gyan.
A Tirthankara does not get any Upsarg after attaining keval-gyan. But Mahavira did get and was affected by Goshalak’s Tejoleshya.
This has been described as an exception or one of the ten ‘surprises’ of Jain history. It is mentioned in the Jain scripture, Sthanaang Sootra.