Passage: By the end of 17th century, Brunei entered a period of decline brought on by internal strife over royal succession, colonial expansion of the European powers, and piracy. The empire lost much of its territory due to the arrival of the western powers such as the Spanish in the Philippines, the Dutch in southern Borneo and the British in Labuan, Sarawak and North Borneo. Sultan Hashim Jalilul Alam Aqamaddin later appealed to the British to stop further encroachment in 1888. In the same year British signed a "Treaty of Protection" and made Brunei a British protectorate until 1984 when it gained independence.

Question: When did Brunei gain independence?
1984