Megawati was 40 years old when she became politically active in the opposition to Suharto's continued rule. Members of Sukarno's family were recruited to enhance the prestige of the small, weak, Indonesian Democratic Party, a nationalist group that had been founded in the 1920s by Sukarno. Megawati soon became leader of the party and helped to increase its membership. Her family background symbolized an alternative to Suharto's dictatorship. Her threat to Suharto was obvious and his attempt to force her removal as party head, with violent attacks on her headquarters in 1996, led to mass demonstrations in her support. Megawati was portrayed as an heroic figure, like Aung San Suu Kyi of Myanmar (Burma) or Corazon Aquino of the Philippines, but she remained personally reclusive, avoiding statements or speeches, rather than coming forth as an impassioned orator inspiring the opposition. Megawati's actual role in the downfall of Suharto in 1998 appeared remarkably minimal. Her party and her name remained very popular when she ran
in the subsequent 1999 national election, even though she refused interviews and debates.
In 1999, when Wahid was one of three candidates for the presidency, he stated that he would be willing to step down in favor of Megawati, leader of the Indonesian Democratic Party, the then main opposition party. Before the voting in the People's Consultative Assembly in October 1999, however, Wahid's shrewd political maneuvers won him the support of Golkar (Suharto's party) and played on the resistance of Muslim parties to a female head of state, enabling him to defeat Megawati for the presidency, even though he had little more than 10% of the popular vote and she had won over half. Megawati urged her outraged followers to be calm and she accepted the position of vice president.
As Indonesia's reform process slowed, the economy stagnated and ethnic unrest erupted, while legislative opposition to Wahid gathered momentum. Wahid, in ill-health and widely perceived as unstable to the point of incompetence, fought off attempts to force his resignation but eventually was pushed out. Megawati became the fifth president of Indonesia on 23 July 2001 when Wahid was impeached. The transition was relatively peaceful, in spite of Wahid's resistance to the impeachment process. By 2003, Megawati was firmly in place to finish Wahid's term, due to end in October 2004. In January 2003 she announced plans to seek a second term in the elections scheduled later that year.