Question: When did the territory that had been compared to Gibraltar become part of the British Empire?

full_context: Document 1: Pacific War: In January, Japan invaded Burma, the Dutch East Indies, New Guinea, the Solomon Islands and captured Manila, Kuala Lumpur and Rabaul. After being driven out of Malaya, Allied forces in Singapore attempted to resist the Japanese during the Battle of Singapore but surrendered to the Japanese on 15 February 1942; about 130,000 Indian, British, Australian and Dutch personnel became prisoners of war. The pace of conquest was rapid: Bali and Timor also fell in February. The rapid collapse of Allied resistance had left the "ABDA area" split in two. Wavell resigned from ABDACOM on 25 February, handing control of the ABDA Area to local commanders and returning to the post of Commander-in-Chief, India.
Document 2: British Empire: By the turn of the 20th century, fears had begun to grow in Britain that it would no longer be able to defend the metropole and the entirety of the empire while at the same time maintaining the policy of "splendid isolation". Germany was rapidly rising as a military and industrial power and was now seen as the most likely opponent in any future war. Recognising that it was overstretched in the Pacific and threatened at home by the Imperial German Navy, Britain formed an alliance with Japan in 1902 and with its old enemies France and Russia in 1904 and 1907, respectively.
Document 3: Modern history: On December 7, 1941, Japan attacked the United States at Pearl Harbor, bringing it too into the war on the Allied side. China also joined the Allies, as eventually did most of the rest of the world. China was in turmoil at the time, and attacked Japanese armies through guerilla-type warfare. By the beginning of 1942, the major combatants were aligned as follows: the British Commonwealth, the United States, and the Soviet Union were fighting Germany and Italy; and the British Commonwealth, China, and the United States were fighting Japan. The United Kingdom, the United States, the Soviet Union and China were referred as a "trusteeship of the powerful" during the World War II  and were recognized as the Allied "Big Four" in Declaration by United Nations These four countries were considered as the "Four Policemen" or "Four Sheriffs" of the Allies power and primary victors of World War II. From then through August 1945, battles raged across all of Europe, in the North Atlantic Ocean, across North Africa, throughout Southeast Asia, throughout China, across the Pacific Ocean and in the air over Japan.
Document 4: First Anglo-Burmese War: Sign a commercial treaty in due courseThe first installment of indemnity was to be paid immediately, the second installment within the first 100 days from signing of the treaty, and the rest within two years. Until the second installment was paid, the British would not leave Yangon.The Treaty of Yandabo was signed by General Campbell from the British side and Governor of Legaing Maha Min Hla Kyaw Htin from the Burmese side on 24 February 1826. The Burmese paid 250,000 pounds sterling in gold and silver bullion as the first installment of the indemnity, and also released British prisoners of war. The war was thus brought to an end, and the British army moved south. The British army remained in the territories surrendered to it under the treaty and in the territories such as the Rangoon area which were occupied for several years in the guarantee of the financial terms of the treaty.
Document 5: British Empire: The changing world order that the war had brought about, in particular the growth of the United States and Japan as naval powers, and the rise of independence movements in India and Ireland, caused a major reassessment of British imperial policy. Forced to choose between alignment with the United States or Japan, Britain opted not to renew its Japanese alliance and instead signed the 1922 Washington Naval Treaty, where Britain accepted naval parity with the United States. This decision was the source of much debate in Britain during the 1930s as militaristic governments took hold in Japan and Germany helped in part by the Great Depression, for it was feared that the empire could not survive a simultaneous attack by both nations. Although the issue of the empire's security was a serious concern in Britain, at the same time the empire was vital to the British economy.
Document 6: History of Singapore: On 7 June 1823, John Crawfurd signed a second treaty with the Sultan and Temenggong, which extended British possession to most of the island. The Sultan and Temenggong traded most of their administrative rights of the island, including the collection of port taxes for lifelong monthly payments of $1500 and $800 respectively. This agreement brought the island under the British Law, with the provision that it would take into account Malay customs, traditions and religion. Raffles replaced Farquhar with John Crawfurd, an efficient and frugal administrator, as the new governor. In October 1823, Raffles departed for Britain and would never return to Singapore as he died in 1826, at the age of 44. In 1824, Singapore was ceded in perpetuity to the East India Company by the Sultan.
Document 7: Founding of modern Singapore: In 1818, Sir Thomas Stamford Raffles was appointed Lieutenant Governor of the British colony at Bencoolen. Raffles believed that the British should find a way to challenge the dominance of the Dutch in the area. The trade route between China and British India passed through the Malacca Strait, and with the growing trade with China, that route would become increasingly important. However, the Dutch had tight control over the trade in the region and intended to enforce the exclusive rights of its company ships to trade, and that trade should be conducted at its entrepot Batavia. British trading ships were heavily taxed at Dutch ports, stifling British trade in the region.
Document 8: British Empire: In December 1941, Japan launched, in quick succession, attacks on British Malaya, the United States naval base at Pearl Harbor, and Hong Kong. Churchill's reaction to the entry of the United States into the war was that Britain was now assured of victory and the future of the empire was safe, but the manner in which British forces were rapidly defeated in the Far East irreversibly harmed Britain's standing and prestige as an imperial power. Most damaging of all was the fall of Singapore, which had previously been hailed as an impregnable fortress and the eastern equivalent of Gibraltar. The realisation that Britain could not defend its entire empire pushed Australia and New Zealand, which now appeared threatened by Japanese forces, into closer ties with the United States. This resulted in the 1951 ANZUS Pact between Australia, New Zealand and the United States of America.
Document 9: Christmas Island: At Australia's request, the United Kingdom transferred sovereignty to Australia, with a M $20 million payment from the Australian government to Singapore as compensation for the loss of earnings from the phosphate revenue. The United Kingdom's Christmas Island Act was given royal assent on 14 May 1958, enabling Britain to transfer authority over Christmas Island from Singapore to Australia by an order - in - council. Australia's Christmas Island Act was passed in September 1958 and the island was officially placed under the authority of the Commonwealth of Australia on 1 October 1958.
Document 10: Water conflicts between Malaysia and Singapore: On 1 September 1961, the Federation of Malaya signed an agreement giving Singapore the right to draw up to 86 million imperial gallons (390,000 m) of water per day collectively from the Tebrau River, the Skudai River, the Pontian Reservoir, and the Gunung Pulai Reservoir, with effect through 2011. On 29 September 1962, a further agreement was signed providing Singapore the right to draw up to 250 million imperial gallons (1,100,000 m) per day from the Johor River, with effect until 2061. Both agreements stipulated the price of 3 Malaysian cents per 1,000 imperial gallons (4,500 L).
Document 11: History of Singapore: In 1818, Sir Stamford Raffles was appointed as the Lieutenant Governor of the British colony at Bencoolen. He was determined that Great Britain should replace the Netherlands as the dominant power in the archipelago, since the trade route between China and British India, which had become vitally important with the institution of the opium trade with China, passed through the archipelago. The Dutch had been stifling British trade in the region by prohibiting the British from operating in Dutch-controlled ports or by subjecting them to a high tariff. Raffles hoped to challenge the Dutch by establishing a new port along the Straits of Malacca, the main ship passageway for the India-China trade. He needed a third port since the British only had the ports of Penang and Bencoolen. The port had to be strategically located along the main trade route between India and China and in the middle of the Malay Archipelago. He convinced Lord Hastings, the Governor-General of India and his superior at the British East India Company, to fund an expedition to seek a new British base in the region.
Document 12: History of Australia: British Malaya quickly collapsed, shocking the Australian nation. British, Indian and Australian troops made a disorganised last stand at Singapore, before surrendering on 15 February 1942. Around 15,000 Australian soldiers became prisoners of war. Curtin predicted that the "battle for Australia" would now follow. On 19 February, Darwin suffered a devastating air raid, the first time the Australian mainland had ever been attacked by enemy forces. Over the following 19 months, Australia was attacked from the air almost 100 times.
Document 13: British Empire: By the start of the 20th century, Germany and the United States challenged Britain's economic lead. Subsequent military and economic tensions between Britain and Germany were major causes of the First World War, during which Britain relied heavily upon its empire. The conflict placed enormous strain on the military, financial and manpower resources of Britain. Although the British Empire achieved its largest territorial extent immediately after World War I, Britain was no longer the world's pre-eminent industrial or military power. In the Second World War, Britain's colonies in South-East Asia were occupied by Imperial Japan. Despite the final victory of Britain and its allies, the damage to British prestige helped to accelerate the decline of the empire. India, Britain's most valuable and populous possession, achieved independence as part of a larger decolonisation movement in which Britain granted independence to most territories of the Empire. The transfer of Hong Kong to China in 1997 marked for many the end of the British Empire. Fourteen overseas territories remain under British sovereignty. After independence, many former British colonies joined the Commonwealth of Nations, a free association of independent states. The United Kingdom is now one of 16 Commonwealth nations, a grouping known informally as the Commonwealth realms, that share one monarch—Queen Elizabeth II.
Document 14: Consequences of the attack on Pearl Harbor: On December 8, 1941, Japan declared war on the United States and the British Empire. The Japanese document discussed world peace and the disruptive actions of the United States and the United Kingdom. The document claimed all avenues for averting war had been exhausted by the Government of Japan.
Document 15: History of Singapore: During World War 2, Singapore was conquered and occupied by the Japanese Empire from 1942 to 1945. When the war ended, Singapore reverted to British control, with increasing levels of self-government being granted, culminating in Singapore's merger with the Federation of Malaya to form Malaysia in 1963. However, social unrest and disputes between Singapore's ruling People's Action Party and Malaysia's Alliance Party resulted in Singapore's expulsion from Malaysia. Singapore became an independent republic on 9 August 1965.
ground_truth: 7 June 1823
sub_queries: Which territory had been compared to Gibraltar? Answer: Singapore
when did Singapore became part of the british empire Answer: 7 June 1823