NEW DELHI — India’s Parliament capitulated on Saturday to the anticorruption campaigner Anna Hazare and the hundreds of thousands of people who took to the streets to support his cause in a standoff that lasted nearly two weeks.

After a day of wrangling and speechifying, Parliament adopted a resolution endorsing Mr. Hazare’s central demands for shaping legislation to create an independent anticorruption agency empowered to scrutinize public officials and bureaucrats in India.

Mr. Hazare, 74, has been waging a hunger strike for 12 days, refusing to call it off unless Parliament adopted his proposed legislation to fight graft rather than a bill put forward by the government. Huge crowds of supporters have participated in peaceful protests and rallies across India in what became an outpouring of public disgust over corruption.

After Parliament accepted some of his demands in a nonbinding "sense of the house" vote, Mr. Hazare ended his fast on Sunday, accepting a glass of juice from a 5-year-old girl, according to The Associated Press.