An Indian judge has ordered three men to be hanged after they were convicted of two gang-rapes, the first death sentences to be handed down for multiple sex attacks since the law was toughened in 2013.

The sentences were announced at a court in Mumbai on the same day that a judge jailed 24 men in the southern state of Kerala over the gang-rape of a schoolgirl who was repeatedly sexually assaulted over a 40-day period in 1996.

A series of mass protests over the levels of sexual violence prompted the government to amend the law last year and allow for harsher punishments for rapists, including the death penalty for repeat offenders.

The three who were sentenced had been found guilty of two attacks in July and August last year at the same abandoned mill in Mumbai, including an attack on a photojournalist that made global headlines.

Mohammed Salim Ansari, 28, Vijay Mohan Jadhav, 19, and Mohammed Kasim Hafeez Shaikh, 21, were convicted last month after a fast-track trial.

They were subsequently handed life sentences for one of those assaults, the gang-rape of an 18-year-old phone operator, but they were also convicted this week under a new section of the law for being repeat rape offenders, which carries the death penalty.

"There needs to be zero-tolerance for such incidents," Judge Shalini Phansalkar Joshi said as she announced the sentences. "A loud and clear message needs to be sent to society."

A special public prosecutor, Ujjwal Nikam, confirmed to AFP that this was the first conviction for repeat rape under the modified law.

The men bowed their heads as they learned their fate, while one of their mothers was removed from the court for swearing.

The 22-year-old photojournalist was gang-raped while on assignment with a male colleague in the overgrown mill compound, close to an upscale neighbourhood as well as slums from which most of the rapists hailed. The other victim, attacked in the same place, came forward after reading about the photojournalist's ordeal.

Two other men have been jailed for life over the attacks: Mohammed Ashwaq Sheikh in the telephone operator case and Siraj Rehmat Khan in the case of the photojournalist.

A juvenile is being separately tried over the attack on the photojournalist, which sparked anger in Mumbai, a city usually considered safer than the capital Delhi.