In the mid-16th century, the area was under Portuguese rule until the Ottomans forced out the Europeans. Nomadic tribes in the area included the Bani Naim and the Bani Ubtah, who migrated from Kuwait to the northwest coast to found the pearling town of Zubarah.

The Al-Khalifa clan, part of the Bani Ubtah, were the dominant family in Qatar and in Bahrain until 1868. After a Bahraini force sacked and looted Doha and Al-Wakrah, Sheikh Mohammed bin Thani signed a treaty with Britain, whose East India Company had been trading on the Trucial Coast for almost 50 years. The treaty implicitly recognised Bahrain and Qatar as separate entities.

On 25 June 2013, Sheikh Hamad voluntarily ceded power to his 33-year-old son

The Al-Thani rulers accepted Ottoman sovereignty in 1872 until 1913. In 1916, Sheikh Abdullah bin Jassim al-Thani signed a treaty with Britain, bringing Qatar into the trucial system. Doha became a British administrative centre and, in 1922, when US and British firms were debating oil concessions, it was separated from US interests in Saudi Arabia. The first oil survey in Qatar was conducted by the Anglo-Persian Oil Company in 1926, but no oil was found.

In the 1930s, the collapse of the pearl market coincided with increased competition for oil concessions. In 1934, as part of concession negotiations, Britain extended its protection over Qatar with an agreement to help defend it. The next year, Petroleum Development (Qatar) was granted a 75-year concession to explore for oil.

Qatar continued to squabble with Bahrain over rights to land and islands, including Hawar on its west coast. The disputes continued until 2001, when the International Court of Justice in the Hague ruled that Bahrain had sovereignty over Hawar, but that Zubarah was Qatari.

In 1938, Petroleum Development (Qatar) began drilling for oil, and in 1939 high-quality crude was discovered at Dukhan. By the end of the 1940s, oil-related products were being exported from Umm Said (now Mesaieed). One of Sheikh Abdullah’s last acts before he died was to sign a deal with the US’ Central Mining & Investment Corporation, which started offshore exploration in partnership with Superior Oil. It found nothing and relinquished its concession, which was then transferred to the Shell Company of Qatar in 1952. Doha began to grow on the back of oil revenues, and in 1952 Qatar’s first school opened. By the late 1950s, Doha airport was receiving flights and the country had its first large hospital.

Qatar joined Opec in 1961, and in 1963, the offshore oil field at Maydan Mahazam was discovered. A year later, Shell began full-scale production at the Al-Shargi field, the first seabed reservoir to be operated from offshore facilities. By the 1960s, Qatar was excavating a deep-water port to handle cargo trans-shipments and Britain had announced a policy of ending treaty relations with Gulf sheikhdoms.

On 1 September 1971, Qatar gained independence and two days later signed a treaty of friendship with Britain. The emir, Sheikh Ahmed bin Ali al-Thani, announced independence from his Swiss villa, reinforcing popular sentiment that he might not be the best man for the job. On 22 February 1972, while Sheikh Ahmed was in Iran hunting with falcons, his cousin, Sheikh Khalifa bin Hamad al-Thani, took power. Sheikh Ahmed lived in exile in the UAE with his wife Mariam, sister of Dubai’s ruler Sheikh Mohammed, until his death in 1977. That year, the UK/Dutch Shell Group’s offshore concession was taken over by Qatar Petroleum Company (now Qatar Petroleum or QP).

Sheikh Khalifa cut back on allowances to members of the Al-Thani family and spent more on building up Qatar’s infrastructure and social institutions, including the University of Qatar, which opened in 1975.

In 1974, Shell discovered the North Field, the largest non-associated gas field in the world, and in 1980, a $4bn programme was begun to build a liquefied natural gas (LNG) terminal at Ras Laffan on Qatar’s northern tip. Gas production began in 1991 and LNG exports in 1996.

Sheikh Hamad bin Khalifa Al-Thani, Sheikh Khalifa’s heir apparent and Qatar’s defence minister, took on increasing amounts of the daily running of the country as the emir spent more time abroad. On 27 June 1995, while his father was holidaying in Switzerland, Sheikh Hamad took power in another bloodless coup.

The new emir announced his intention to move towards a more open society and a free press, backing this up by launching the Al-Jazeera satellite television news channel. He approved a new constitution in 2004 and Qatar has been growing in strength and stature since.

On 25 June 2013, Sheikh Hamad voluntarily ceded power to his son, the 33-year-old Sheikh Tamim bin Hamad al-Thani. The fourth and youngest son of Sheikh Hamad and his second wife, Sheikha Mozah bint Nasser al-Missned, Sheikh Tamim had been heir apparent since his older brother Sheikh Jasim bin Hamad al-Thani renounced his right to the throne.