The Netherlands has issued its first general and formal apology to Indonesia for thousands of summary executions carried out by its army in an effort to stop an uprising against their colonial rule.

Dutch ambassador to Indonesia Tjeerd de Zwaan apologised for the "excesses committed by Dutch forces" between 1945 and 1949, when the Netherlands finally recognised Indonesia's independence.

The ceremony took place at the Dutch embassy in Jakarta, with several relatives of the victims and embassy workers in attendance. However, the victims' widows could not be present, as they live in Sulawesi and were not physically able to attend due to their advanced age. Only one of the widows has remarried.

"The Dutch government is aware that it bears a special responsibility in respect of Indonesian widows of victims of summary executions," Zwaan said.

"Sometimes it is very important to be able to look back in order to be able to look one another straight in the eyes and be able to move forward together - and that of course is what this public apology and ceremony is all about," he said.

The Dutch had dominated the Indonesian archipelago for three centuries and exploited it for its precious spices and cash crops. During World War II, Japan forced the Dutch out of Indonesia and the local population began to push for independence.

After the defeat of the Japanese forces at the end of the war, the Dutch attempted to reassert control over the archipelago. They met fierce resistance.

The worst Dutch massacres took place in South Sulawesi. In January 1947, more than 200 Indonesian men were executed on a field in front of a local government office.

Infamous captain Raymon Westerling led the execution of thousands of people in South Sulawesi between December 1946 and March 1947. The "Westerling Method" included executions of people suspected of involvement in any anti-Dutch activity.

According to some Indonesian figures, a total of 40,000 people were killed. Historian Jaap de Moor has put the death toll as a direct result of actions by the Special Forces at around 1,500.

The Dutch government has given ten widows £16,800 after their lawyer Liesbeth Zgvedl managed to make a deal.

The first major apology by the Dutch government did not come until 2011, over the 1947 massacre of at least 150 people in the village of Rawagede on the island of Java. The apology came after the government was sued in a Dutch court in an unprecedented class action.

Dutch prime minister Mark Rutte has planned a visit to Indonesia in November.