Hemachandra became the advisor to Kumarapala. During Kumarapala's reign, Gujarat became a center of culture. Using the Jain approach of Anekantavada, Hemchandra is said to have displayed a broad-minded attitude, which pleased Kumarapala. Kumarapala was a Shaiva and ordered the rebuilding of Somnath at Prabhas Patan. Some people who were jealous of Hemachandra's rising popularity with the Kumarapala complained that Hemachandra was a very arrogant person, that he did not respect the devas and that he refused to bow down to Shiva. When called upon to visit the temple on the inauguration with Kumarapala, Hemachandra readily bowed before the lingam but said:I bow down to him who has destroyed the passions like attachment and malice which are the cause of the cycle of birth and death; whether he is Brahma, Vishnu, Shiva or Jina. Ultimately, the king became a devoted follower of Hemachandra and a champion of Jainism.