In the early 17th century, Sri Lanka was partly ruled by the Portuguese and Sri Lankan kingdoms, who were constantly battling each other. Although the Portuguese were not winning the war, their rule was rather burdensome to the people of those areas controlled by them. While the Portuguese were engaged in a long war of independence from Spanish rule, the Sinhalese king (the king of Kandy) invited the Dutch to help defeat the Portuguese. The Dutch interest in Ceylon was to have a united battle front against the Iberians at that time.