NEW DELHI — An Indian cabinet minister quit on Wednesday after 21 women came forward to accuse him of sexual harassment, making him the most prominent figure so far to be felled by the #MeToo movement sweeping the world’s largest democracy.

The minister, M.J. Akbar, said he was stepping down to fight his accusers in court. On Thursday, an Indian court will hear the defamation case that Mr. Akbar and his 97 lawyers have brought against Priya Ramani, the first woman to publicly accuse him of harassment dating back to a time when he was a prominent newspaper editor.

“I deem it appropriate to step down from office and challenge the false accusations levied against me, also in a personal capacity,” Mr. Akbar’s resignation letter said. “I have, therefore, tendered my resignation from the office of minister of state of external affairs.” The position is akin to a deputy secretary of state

After a slow start, India’s #MeToo movement has shaken the country over the past two weeks, as dozens of women in journalism, entertainment, the arts and advertising have accused powerful men in their fields of sexual harassment or assault. The allegations have led to apologies, resignations, professional shunning and in some cases, counterattacks.