Police have deployed across the Indian state of Tamil Nadu to ensure security as thousands came out to mourn actress turned politician Jayaram Jayalalithaa, after her death at the age of 68.

The chief minister of Tamil Nadu died after undergoing surgery following a heat attack on Sunday night at the Apollo Hospital in the southern Indian city of Chennai, the hospital said.

The state declared a seven-day mourning period in honour of the politician known by her followers as Amma, which means Mother in the Tamil language.

Jayalalithaa inspired intense loyalty among film fans and political supporters.

As news of her death spread, thousands of people thronged the road long past midnight to watch as a motorcade escorted the ambulance carrying her body from the hospital to her home.

Police had a hard time controlling people from rushing on to the road.

Bollywood and Tamil actors praised the former thespian and expressed sorrow over her passing.

"Not just Tamil Nadu but India has lost a brave daughter. I pray to God to rest her soul in peace," Tamil superstar Rajinikanth said in a Twitter message.

Fearing her death might trigger widespread violence and rioting, police deployed across the state.

The neighbouring state of Karnataka stopped public buses from travelling to Tamil Nadu after one of its buses was attacked on Monday.

The US Consulate in Chennai urged Americans to be careful in the city and to avoid large crowds.

Tamil Nadu and Kerala declared public holidays. In Tamil Nadu, schools, offices and businesses will be closed for the next three days.

Jayalalithaa's body, in a coffin draped with the national flag, was taken to a public hall in Chennai to allow people to pay their respects.

The date and time of her funeral has not been announced as the state government needed time to arrange security to handle the hundreds of thousands of people expected to attend.

Within hours of her death, her trusted lieutenant, O Panneerselvam, was sworn in as chief minister of the state.

Indian prime minister Narendra Modi said he was "deeply saddened" by Jayalalithaa's death. "Her demise has left a huge void in Indian politics," Modi tweeted.

She had been in hospital for two months after being admitted with a fever, dehydration and a respiratory infection.

At the time, thousands of people prayed and fasted outside the hospital for her recovery. Doctors barred visitors, sparking rumours that they were withholding bad news out of fear it could trigger the same outpouring of grief, riots and suicides that followed the death of Jayalalithaa's political and acting mentor, MG Ramachandran.

Jayalalithaa was kept on a ventilator in the intensive care unit for weeks, doctors said. She also suffered from diabetes.

She was 13 when she began her film career and quickly became known as a romantic lead in many of the nearly 150 Tamil-language movies she worked on.

She entered politics in the early 1980s, under the guidance of Ramachandran, and after his death in 1987 she declared herself his political heir and took control of the All India Anna Dravida Munnetra Kazhgam party.

She served as Tamil Nadu's chief minister, the highest elected position in the state of 71 million people, for nearly 14 years over five terms beginning in 1991. She regained her office last year after a corruption case against her was overturned.

Her supporters praised her efforts in fighting rural poverty with handouts like laptop computers for students, cows and goats for farmers, and spice grinders for homemakers.

Gifts are commonly used by Indian political parties to court voters, but her handouts were criticised by some as wasteful pandering and unfair bribery. She defended the giveaways as welfare measures aimed at helping the poor.

She was known for leading an extravagant lifestyle. In 1997, police found more than 10,000 saris and 750 pairs of shoes after raiding her home as part of a corruption investigation.

In the first half of 2014, Jayalalithaa made a bid to become India's prime minister by saying she would form a coalition in New Delhi if no party dominated elections, but the Bharatiya Janata Party won a clear majority, catapulting Mr Modi into the top job.

Later that year, she was forced to step down as chief minister in Tamil Nadu when she was sentenced to four years in prison for amassing more than 10 million dollars during her political career, a wealth the court said was disproportionate to her income.

She spent 21 days behind bars before the Indian Supreme Court released her on bail. In May last year, an appeals court overturned the corruption charges, clearing the way for her return to power. She returned to office as chief minister on May 23 and a month later was re-elected in a by-election.

Jayalalithaa was born in 1948 in the village of Melukote, in what is now the state of Karnataka. Her birth name was Jayalalitha, but she reportedly added an "a'' on advice from a numerologist.

Her lawyer father, also named Jayaram, died when she was two, prompting her mother to learn shorthand and typing so she could work in a clerical position to support the family and put Jayalalithaa and her brother through school. Her brother died in the early 1990s.