The Kingdom of Kongo (which covered parts of what is now the Republic of Congo, Democratic Republic of the Congo and Angola) had seen a serious dispute over the royal succession for more than a century (from the death of Afonso in 1542). In 1568 the kingdom was overrun by the Jagas, a warrior society to the south-east. King (Manikongo) Álvaro I Nimi a Lukeni required military aid from the Portuguese to restore the kingdom -- in return, the Portuguese were allowed to settle at Luanda, where the colony that became Angola (established 1575) was founded. However, the relationship between the Kingdom of Kongo and the Portuguese soon deteriorated. In 1622 Portuguese forces invaded Kongo territory, and decisively won a battle against local troops at Mbumbi. Manikongo Pedro II responded, and managed to defeat the invaders at Mbamba.
Manikongo Garcia II Nkanga a Lukeni came to the Kongo throne in 1641, and promptly allied with the Dutch against the Portuguese, and territory claimed by the Portuguese was captured. Decades of conflict were brought to an end with a major battle in the disputed district of Mbwila.
On 29 October 1665 the Battle of Mbwila (aka Battle of Ulanga) was won by Portuguese forces, and the reigning Manikongo António I Nvita a Nkanga was killed during the battle. The Kingdom of Kongo found itself torn between two factions, the Kimpanzu and Kinlaza, who disputed the succession. Civil war decimated the kingdom for the remainder of the 17th century, and the Portuguese took advantage through the trans-Atlantic slave trade.