The earliest human remains found on the island of Sri Lanka date to about 35,000 years ago . The proto-historical period begins roughly in the 3rd century, based on chronicles like the Mahavamsa, Dipavamsa, and the Culavamsa. The earliest documents of settlement in the Island are found in these chronicles. These chronicles cover the period since the establishment of the Kingdom of Tambapanni in the 6th century BCE. The first Sri Lankan ruler of the Anuradhapura Kingdom, Pandukabhaya, is recorded for the 4th century BCE. Buddhism was introduced in the 3rd century BCE by Arhath Mahinda . The first Tamil ruler of the Anuradhapura Kingdom, Ellalan, an invader, is recorded for the 2nd century BCE. The island was divided into numerous kingdoms over the following centuries, intermittently  united under Chola rule. Sri Lanka was ruled by 181 monarchs from the Anuradhapura to Kandy periods.From the 16th century, some coastal areas of the country were also controlled  by the Portuguese, Dutch and British.Between 1597 and 1658, a substantial part  of the island was under Portuguese rule. The Portuguese lost their possessions in Ceylon due to Dutch intervention in the Eighty Years' War. Following the Kandyan Wars, the island was united under British rule in 1815.Armed uprisings against the British took place in the 1818 Uva Rebellion and the 1848 Matale Rebellion. Independence was finally granted in 1948 but the country remained a Dominion of the British Empire until 1972. In 1972 Sri Lanka assumed the status of a Republic. A constitution was introduced in 1978 which made the Executive President the head of state. The Sri Lankan Civil War began in 1983, including an armed youth uprising in 1971 and 1987-1989, with the 25-year-long civil war ending in 2009.
Question: Which happened first, the Portuguese losing possessions in Ceylon or the Portuguese primarily ruling the island?
Answer: Portuguese primarily ruling the island