Offices and shops in India's tech capital of Bengaluru shut on Friday and police were brought in to control swarming crowds of fans in anticipation of violence after a popular actor died in the city.

Puneeth Rajkumar, 46, a dashing lead in films and a member of an illustrious movie family, died of a heart attack on Friday afternoon, doctors treating him told reporters.

Television channels showed crowds of fans swarming toward the hospital where he was being treated, and police were out in force trying to control them.

Film stars are revered in India, almost obsessively and even natural deaths of movie stars have led to violent turmoil in the past as distraught fans try to come to terms with the death of their idol.

The death of Rajkumar's father, Singanalluru Puttaswamaiah Muthuraj, in 2006 also led to outpourings of grief and shutdowns.

"I pray to the people of the state to do his last rites with respect, please be peaceful and allow the family to mourn in peace," the chief minister of Karnataka state, Basavraj Bommai, told a news conference minutes after the actor's death was announced.