An Indian woman cut off a man's penis after he allegedly tried to rape her at her house in the southern state of Kerala, police said on Saturday.

The 23-year-old law student was at her residence in the state capital Thiruvananthapuram late Friday when she says she was attacked by the 54-year-old man, who had claimed to her family to be a religious guru.

"She used a knife in her defence and cut off his penis," said district police chief G Sparjan Kumar.

"The man, Hari Swami, was rushed to the nearby government hospital in a serious state," he added.

The local media reported that Swami was in a stable condition after undergoing emergency medical procedures at the local hospital.