The territory's curious status is the result of an unresolved border dispute between Malaysia and Brunei that dates back to the British colonial era.