A general election in June 1999 produced the first freely elected national, provincial and regional parliaments in over forty years.
In October 1999 the MPR elected a compromise candidate, Abdurrahman Wahid, as the country's fourth president, and Megawati Sukarnoputri — a daughter of Sukarno, the country's first president — as the vice president. Megawati's PDI-P party had won the largest share of the vote (34%) in the general election, while Golkar, the dominant party during the Suharto era, came in second (22%). Several other, mostly Islamic parties won shares large enough to be seated in the DPR. Further democratic elections took place in 2004 and 2009.