Not long after Mahsuri's death, in 1821, the Siamese army invaded Kedah, and attacked Langkawi.
In the first attack, the locals decided to burn down the granary at Padang Matsirat to starve and drive out the Siamese army.
In 1909, the islands came under British rule under the Anglo-Siamese Treaty of 1909.
The middle of the channel between Tarutao National Park and Langkawi would become the Siamese border, and Tarutao would be part of Siam while all the Langkawi islands to the south would come under British rule.
The total land mass of the islands is 47,848 hectares.
The main island spans about 25 km from north to south and slightly more for east and west.Langkawi remained as a quiet backwater until 1986, when the then Prime Minister Mahathir Mohamad decided to transform it into a major tourist resort, helping to plan many of the islands buildings himself.Langkawi, a cluster of 99 islands separated from mainland Malaysia by the Strait of Malacca, is a district of the state of Kedah in northern Malaysia and lies approximately 51 km west of Kedah.The island's oldest geological formation, the Machinchang Formation, was the first part of Southeast Asia to rise from the seabed in the Cambrian more than half a billion years ago.The oldest part of the formation is observable at Teluk Datai to the north-west of the island, where the exposed outcrop consists of mainly sandstone (quartzite) in the upper parts and shale and mudstone in the lower parts of the sequence.Langkawi, officially known as Langkawi, the Jewel of Kedah (Malay: Langkawi Permata Kedah), is a district and an archipelago of 99 islands ( 5 small islands visible only at low tide) in the Andaman Sea some 30 km off the mainland coast of northwestern Malaysia.The islands are a part of the state of Kedah, which is adjacent to the Thai border.The population is approximately 99,000, around 65,000 of them in Langkawi, of which 90% are Malays.The other ethnic groups consist mainly of Chinese, Indians, and Thais. Other major religions are Hinduism (mainly among Indians), Buddhism (mainly among Chinese and Thai), and Christianity (mostly Chinese).In a series of operations, between December 1945 and March 1946, the British cleared the pirates' land base in Langkawi and Tarutao.The British continued to rule until Malaya gained its independence in 1957.