Qatar has been ruled by the House of Thani since Mohammed bin Thani signed a treaty with the British in 1868 that recognised its separate status. Following Ottoman rule, Qatar became a British protectorate in the early 20th century until gaining independence in 1971. The hereditary emir of Qatar rules as an autocrat (currently, Tamim bin Hamad Al Thani) and holds all executive and legislative authority, as well as controlling the judiciary system. He appoints the prime minister and cabinet.