NEW DELHI — An Indian court on Wednesday sentenced an influential guru to life in prison for the rape of a teenage girl, putting to rest a long legal battle that has been marred by the murder of at least two witnesses connected to the case.

The conviction of the white-bearded guru, Asaram Bapu, in the 2013 rape of a 16-year-old follower who was studying at one of his ashrams comes during a time of national reckoning on sexual assault in India.

Over the past few weeks, the rape and murder of an 8-year-old girl belonging to a nomadic community in northern India has dominated the news, spurring heated discussions about how rape should be handled in the country’s courts.

The verdict was read out Wednesday inside the prison where Mr. Bapu is being held in the city of Jodhpur in Rajasthan State. The court said Mr. Bapu had “dented the image of saints among the common masses.” Mr. Bapu’s followers said his legal team would appeal the verdict. The court also sentenced two of Mr. Bapu’s aides to 20 years in prison and dropped charges against two others.