Analysts say Sonia Gandhi had tried to pre-empt a campaign by the opposition Hindu nationalist Bharatiya Janata Party (BJP) over the controversy and claim the moral high ground.
It is believed that the government, headed by Manmohan Singh, was under no danger, and that Gandhi would likely return to parliament in six months after a fresh election.
"I have decided to resign from the Lok Sabha [lower house of parliament] and the national advisory council," Gandhi told a news conference on Thursday, saying that she would contest elections again for her parliamentary seat.
"For the last two days, some people in the country were trying to create an impression that parliament was being misused for my benefit.
"This has hurt me. I have said before that in my political and personal life, I have not wanted any private benefit."
India's constitution bars members of parliament from holding what it calls an office of profit, which means any government post that entitles them to pay and benefits. But in practice many politicians also serve on official bodies outside of parliament.
"The government had been driven to a wall and was heading for a political whirlpool without an exit. She has found an exit"
Mahesh Rangarajan, political analyst
The controversy involving Gandhi came after another MP was disqualified this month for serving as head of a state cinema development board.
Since then, several petitions have been filed against other members, including the Italian-born Gandhi, whose party came to power at the head of a communist-backed coalition in May 2004.
About 40 further politicians are believed to hold such positions.
The National Advisory Council was established to advise the coalition government on policy and give Gandhi a supervisory role after she declined the post of prime minister.
The government abruptly adjourned parliament on Wednesday and was reportedly considering issuing an emergency ordinance to change the law over the "office of profit" provision.
This was met by strong protest from the opposition, which accused the government of subverting parliament.
Gandhi said her decision to quit was in line with her "standards of public morality and personal values".
"I have complete faith that my Rae Bareli brothers and sisters and the whole country will understand my wishes," she said referring to her constituency in the northern Indian state of Uttar Pradesh.
The news brought dozens of Congress activists to her house in the heart of New Delhi, shouting slogans in her support and asking her not to quit.
A senior minister said Singh had tried to dissuade her from quitting. "The PM is shocked and stunned," he said.
Gandhi gave way to allow Singh
(R) to become PM in 2004
The BJP called the resignation a drama to save face.
"Sonia Gandhi's party and her government was caught red-handed trying to subvert the constitution and parliament. She became a victim of her own conspiracy," the BJP leader, Arun Jaitley said.
"This grand-standing will not help. This is the confession of a culprit caught red-handed trying to subvert the constitution and democracy."
But some analysts said Gandhi might have succeeded in limiting the damage to her party's government.