Dutch colonists and various slave groups begin massacring ethnic Chinese in Batavia, eventually killing 10,000 and leading to a two-year-long war throughout Java.

The 1740 Batavia massacre (Dutch: Chinezenmoord, lit.'Murder of the Chinese'; French: Meurtre des Chinois, lit.'Murder of the Chinese'; Indonesian: Geger Pacinan, lit.'Chinatown tumult') was a massacre and pogrom in which European soldiers of the Dutch East India Company and Javanese collaborators killed ethnic Chinese residents of the port city of Batavia (present-day Jakarta) in the Dutch East Indies. The violence in the city lasted from October 9, 1740, until October 22, with minor skirmishes outside the walls continuing late into November that year. Historians have estimated that at least 10,000 ethnic Chinese were massacred; just 600 to 3,000 are believed to have survived.

In September 1740, as unrest rose among the Chinese population, spurred by government repression and declining sugar prices, Governor-General Adriaan Valckenier declared that any uprising would be met with deadly force. On October 7, hundreds of ethnic Chinese, many of them sugar mill workers, killed 50 Dutch soldiers, leading Dutch troops to confiscate all weapons from the Chinese populace and to place the Chinese under a curfew. Two days later, rumors of Chinese atrocities led other Batavian ethnic groups to burn Chinese houses along Besar River and Dutch soldiers to fire cannons at Chinese homes in revenge. The violence soon spread throughout Batavia, killing more Chinese in cold blood. Although Valckenier declared an amnesty on October 11, gangs of irregulars continued to hunt down and kill Chinese until October 22, when the governor-general called more forcefully for a cessation of hostilities and bitterness. Outside the city walls, clashes continued between Dutch troops and rioting sugar mill workers. After several weeks of minor skirmishes, Dutch-led troops assaulted Chinese strongholds in sugar mills throughout the area.

The following year, attacks on ethnic Chinese throughout Java sparked the two-year Java War that pitted ethnic Chinese and Javanese forces against Dutch troops. Valckenier was later recalled to the Netherlands and charged with crimes related to the massacre. The massacre figures heavily in Dutch literature, and is also cited as a possible etymology for the names of several areas in Jakarta.

The Dutch East Indies (or Netherlands East-Indies; Dutch: Nederlands(ch)-Indië; Indonesian: Hindia Belanda) were a Dutch colony consisting of what is now Indonesia. It was formed from the nationalised trading posts of the Dutch East India Company, which came under the administration of the Dutch government in 1800.

During the 19th century, the Dutch possessions and hegemony expanded, reaching the greatest territorial extent in the early 20th century. The Dutch East Indies was one of the most valuable colonies under European rule, and contributed to Dutch global prominence in spice and cash crop trade in the 19th to early 20th century. The colonial social order was based on rigid racial and social structures with a Dutch elite living separate from but linked to their native subjects. The term Indonesia came into use for the geographical location after 1880. In the early 20th century, local intellectuals began developing the concept of Indonesia as a nation state, and set the stage for an independence movement.Japan's World War II occupation dismantled much of the Dutch colonial state and economy. Following the Japanese surrender in August 1945, Indonesian nationalists declared independence which they fought to secure during the subsequent Indonesian National Revolution. The Netherlands formally recognised Indonesian sovereignty at the 1949 Dutch–Indonesian Round Table Conference with the exception of the Netherlands New Guinea (Western New Guinea), which was ceded to Indonesia 14 years later in 1963 under the provisions of the New York Agreement.