the history of indonesia has been shaped by its geographic position, its natural resources, a series of human migrations and contacts, wars and conquests, as well as by trade, economics and politics. indonesia is an archipelagic country of 17,000 to 18,000 islands (8,844 named and 922 permanently inhabited) stretching along the equator in south east asia. the country's strategic sea-lane position fostered inter-island and international trade; trade has since fundamentally shaped indonesian history. the area of indonesia is populated by peoples of various migrations, creating a diversity of cultures, ethnicities, and languages. the archipelago's landforms and climate significantly influenced agriculture and trade, and the formation of states. the boundaries of the state of indonesia represent the 20th century borders of the dutch east indies.
fossilised remains of homo erectus and his tools, popularly known as the "java man", suggest the indonesian archipelago was inhabited by at least 1.5 million years ago. austronesian people, who form the majority of the modern population, are thought to have originally been from taiwan and arrived in indonesia around 2000 bce. from the 7th century ce, the powerful srivijaya naval kingdom flourished bringing hindu and buddhist influences with it. the agricultural buddhist sailendra and hindu mataram dynasties subsequently thrived and declined in inland java. the last significant non-muslim kingdom, the hindu majapahit kingdom, flourished from the late 13th century, and its influence stretched over much of indonesia. the earliest evidence of islamised populations in indonesia dates to the 13th century in northern sumatra; other indonesian areas gradually adopted islam which became the dominant religion in java and sumatra by the end of the 16th century. for the most part, islam overlaid and mixed with existing cultural and religious influences.
europeans such as the portuguese arrived in indonesia from the 16th century seeking to monopolise the sources of valuable nutmeg, cloves, and cubeb pepper in maluku. in 1602 the dutch established the dutch east india company (voc) and became the dominant european power by 1610. following bankruptcy, the voc was formally dissolved in 1800, and the government of the netherlands established the dutch east indies under government control. by the early 20th century, dutch dominance extended to the current boundaries. the japanese invasion and subsequent occupation in 1942–45 during wwii ended dutch rule, and encouraged the previously suppressed indonesian independence movement. two days after the surrender of japan in august 1945, nationalist leader, sukarno, declared independence and became president. the netherlands tried to reestablish its rule, but a bitter armed and diplomatic struggle ended in december 1949, when in the face of international pressure, the dutch formally recognised indonesian independence.
an attempted coup in 1965 led to a violent army-led anti-communist purge in which over half a million people were killed. general suharto politically outmanoeuvred president sukarno, and became president in march 1968. his new order administration garnered the favour of the west, whose investment in indonesia was a major factor in the subsequent three decades of substantial economic growth. in the late 1990s, however, indonesia was the country hardest hit by the east asian financial crisis, which led to popular protests and suharto's resignation on 21 may 1998. the reformasi era following suharto's resignation, has led to a strengthening of democratic processes, including a regional autonomy program, the secession of east timor, and the first direct presidential election in 2004. political and economic instability, social unrest, corruption, natural disasters, and terrorism have slowed progress. although relations among different religious and ethnic groups are largely harmonious, acute sectarian discontent and violence remain problems in some areas.