NEW DELHI — Arvind Kejriwal, a protest leader who was vaulted into the top post of Delhi’s city government after a startling electoral victory, resigned from his seat after just 49 tumultuous days in office on Friday, saying his central anticorruption initiative was being stonewalled by legislators from India’s two well-established parties.

Mr. Kejriwal had threatened to quit unless Delhi’s legislative assembly passed the Jan Lokpal Bill, which would create a body responsible for investigating complaints of corruption against public officials. The threat initially sounded dramatic, coming so soon after he had taken office. But by Friday, the assembly had descended into uproar, and his motion to introduce a vote on the bill was defeated.

Mr. Kejriwal framed his decision as a principled one, and when he addressed supporters outside his party headquarters, they cheered as if he were announcing a victory. He said he would request that new elections for the legislative assembly be held as soon as possible.

Many viewed his decision as a strategic move, allowing him to shift his focus to a more ambitious goal: Buoyed by its success in Delhi, his Aam Aadmi Party now plans to put forward hundreds of candidates in the general elections in May, posing an unexpected challenge the country’s two heavyweights, Indian National Congress and Bharatiya Janata Party, known by its acronym, B.J.P.