NEW DELHI — An Indian court on Friday sentenced to death three men who raped a photojournalist inside an abandoned textile mill last year in Mumbai, India’s biggest city.


A fourth defendant was sentenced to life in prison, prosecutor Ujjwal Nikam said. He said he asked for the death sentence under a strict anti-rape law introduced following public outrage over a fatal gang rape in New Delhi in 2012.


“This is the first case in India in which the death penalty has been given to convicts while the victim is alive,” Nikam said.


The three men were also found guilty last month of raping a call-center operator at the same abandoned mill in July 2013, a month before the attack on the photojournalist. Nikam described the three as habitual offenders.


Judge Shalini Phansalkar-Joshi said the offense was diabolical in nature and the punishment would send a strong message to Indian society.


India increased penalties for sex crimes and moved rape trials faster through its notoriously slow justice system after a 23-year-old medical student died after being gang-raped on a moving bus in the capital. Four men were sentenced to death in the New Delhi case. The trials in New Delhi and Mumbai cases were completed within seven months.


The four men sentenced in the case in Mumbai, formerly known as Bombay, can appeal their conviction in an appeals court within three months.


Also Friday, 24 men were sentenced to prison for raping a teenager who was abducted in Kerala state in 1996. A court had acquitted all but one defendant in 2005, but India’s top court ordered a retrial last year. It was completed in six months, prosecutor Anella George said.


One man was sentenced to life in prison and 23 others to 7 to 11 years, George said.


The 16-year-old victim was abducted and raped in homes, hotels, cars and public buses over one and a half months. The men convicted in Ernakulam town included a retired professor, lawyers, businessmen and government officials.