his country. Acting on this intelligence and advice, Njinga Ndambi tricked the Portuguese forces into an ambush and massacred them at his capital. The war that followed witnessed a Kongo invasion which was narrowly defeated in 1580, and a Portuguese offensive up the Kwanza river, resulting in the founding of their fort at Massangano in 1582. A number of sobas switched their allegiance to Portugal and soon many of the coastal provinces were joined to the colony. By 1590, the Portuguese decided to attack the core of Ndongo and sent an army against Kabasa itself. Ndongo, however, had recently sealed an alliance with nearby Matamba, and the Portuguese force was crushed. Following this defeat, Ndongo made a counteroffensive and many of the formerly pro-Portuguese sobas returned to Ndongo. But Portugal managed to retain much of the land they had gained in the earlier wars, and in 1599 Portugal and Ndongo formalized their border. The Imbangala period During the early seventeenth century an uneasy peace held between Portugal and Ndongo. The Portuguese continued their expansion along the Kwanza, founding the presidio of Cambambe in 1602 and attempted, whenever possible, to meddle in Ndongo's politics, especially as it concerned Ndongo's tenuous hold on Kisama and other lands south of the Kwanza River. In the course of their activities in the region south of the Kwanza, the Portuguese came into contact with the Imbangala, a rootless group of nomadic raiders who were ravaging the country. In 1615, the temporary Angolan governor Bento Banha Cardoso encouraged some Imbangala to cross the river and enter Portuguese service, and with their help he expanded the colony along the Lukala River, north of Ndongo. In 1617 the new governor Luis Mendes de Vasconcelos, after first rejecting the use of Imbangala troops, committed himself to the alliance and began aggressive campaigns against Ndongo. Thanks to the help of Imbangala bands commanded by Kasanje, Kasa, and others, he was able to invade Ndongo, sack the capital and forced King Ngola Mbandi to take refuge on the island of Kindonga in the Kwanza River. Thousands of Ndongo subjects were taken prisoner, and Mendes de Vasconcelos sought unsuccessfully to create a puppet government to allow Portuguese rule. Mendes de Vasconcelos' successor, João Correia de Sousa, tried to make peace with Ndongo, and in 1621, Ngola Mbandi sent his sister, Nzinga Mbandi to Luanda to negotiate on his behalf. She negotiated a