After the decline of the Malacca Sultanate, numerous sultanates arose on the numerous islands. This includes the slowly growing force of European powers, but their arrival to the region at this time was strictly based on trade; colonization didn't occur in great depth until later centuries. Among the local leaders, the Sultanate of Mataran in Java took great power of that region in the late 1500s. In the early 1600s sultanate was quickly expanding their empire from inland Java to numerous islands, eventually controlling all of Java with the exception of Batavia (Jakarta), which was held by the Dutch.
In the mid-1600s the Mataran Sultanate stopped fighting the Dutch and began creating a monopoly on trade with them. This was done by killing and sacking neighboring people, eventually leading to an attack on the Mataran Sultanate as their kings were exile. This led to turning to the Dutch to regain their lost lands, a move that worked as the sultanate was restored and the Dutch has a friendly and powerful local sultanate to secure their trade routes.
As with previous empires in modern day Indonesia, numerous other rulers controlled many of the islands at the same time the Mataran Sultanate ruled Java and the surrounding islands. Among these, the Sultanate of Banten was perhaps the most powerful as they ruled Banten from the 1500s into the early 1800s.
Although European forces arrived to the region in the 1500s, few made a lasting and permanent difference until later centuries. Many of these powers sought to control the spice trade and sent missionaries, while establishing settlements to guarantee their trade routes. Among these groups, the most influential were the Portuguese and the Dutch. The Portuguese created most of the Christian communities in the islands today and led to the eventually independence of Timor-Leste (East Timor), which was their former colony. The Dutch controlled nearly everything else.
Dutch presence escalated in 1602 when they founded the city of Batavia (Jakarta). At first this was only to protect trade routes, but in the mid-1600s, as already mentioned, they formed an alliance with the Mataran Sultanate and became more intimately involved in the region. From this time until the 1800s the Dutch played small groups against each other, slowly taking over more and more land and islands.
However, the Dutch East Indies Company struggled in the 1700s and by 1800 had declared bankruptcy. This led to the eventually takeover of the region by the Dutch government in 1816. They were immediately faced with challenges and protests, but eventually they created a cultivation system, which forced workers to their land and gave the Dutch full control. This system worked until the early 1900s when they began putting money into the region to improve education, healthcare, and infrastructure.
In the early 1900s independence movements began in Indonesia, but were generally quickly put down by the Dutch as they arrested the movements' leaders. This continued until World War II broke out in the region as Japan began taking numerous islands in 1940. The Dutch offered little assistance since the Netherlands had been taken over by Nazi Germany. This led to division among the people; many sought alliance with the Japanese to gain independence, while others clung to the Dutch. No matter the side, the Japanese eventually took nearly the entire island chain by 1942 at in that year they destroyed the last of the Dutch forces.
In 1942, after the Dutch were expelled, Indonesia declared independence (which wasn't made official at this time) and welcomed the Japanese under the presidency of Sukarno. After Japan's defeat in the war, the Indonesians declared independence without true international support. Despite this, numerous countries recognized the declaration, including the United Kingdom, who pressured the Netherlands to also recognize their independence, which they did in 1949.
The country faced numerous struggles as much of the country's east was destroyed during the war, numerous groups in the country sought independence, and religious extremists arose to fight the government among other issues. Through this time Sukarno sought greater power and in 1959 dissolved the parliament, taking full powers as he hand-picked the new parliament members.
In the 1960s the country's borders were expanded as they moved into Irian (now called New Guinea), numerous other islands, and Malaysia. The real issue at the time though was the economy, which was slowly collapsing. In 1965 this ended with a coup, probably undertaken by the communists, that failed. However it gave the government a reason to kill every communist leaning person in the country. It also allowed Suharto to step in and take power in 1968.
Under Suharto the economy bounced back as foreign investment was encouraged. Military activity also rose as the western half of New Guinea was finally taken as was Timor-Leste. His rule of corruption, but economic progress continued until 1998, when he resigned under political protests and a weakening economy from the East Asian Financial Crisis.
Since Suharto stepped down the country has granted Timor-Leste independence in 2002 and the political realm has become freer in successive elections. There has also been a rise in terrorism as Islamic militants seek greater power and fight the government's policies; this has led to numerous bombings, primarily in the capital of Jakarta. In 2004 a massive earthquake and Tsunami struck off the coast of Indonesia and destroyed nearly everything in northern Sumatra, including the loss of thousands of lives.