Archaeological evidence shows that human habitation existed in Qatar for many centuries prior to the modern age; however, little is known of Qatar's history until the 18th century. The al-Thani family, forebears of the present rulers, arrived in Qatar then from what is now Sa'udi Arabia. During the same century, the al-Khalifah family, who currently rule Bahrain, arrived from Kuwait.
In 1868, Britain intervened on behalf of the Qatari nobles and negotiated the Perpetual Maritime Truce, signed by Muhammad bin Thani, an accord that terminated the Bahraini claim to Qatar in exchange for a tribute payment. In 1872, however, Qatar fell under Ottoman occupation, and Jasim bin Muhammad bin Thani became Turkish deputy-governor of Qatar. Turkish dominion prevailed until the outbreak of World War I and the subsequent withdrawal of the Turks from the Arabian Peninsula. Qatar thereupon established its independence and, in 1916, Sheikh 'Abdallah bin Jasim al-Thani signed a treaty with the United Kingdom granting British protection in exchange for a central role for the United Kingdom in Qatar's foreign affairs. A 1934 treaty further strengthened this relationship. Commercial quantities of high-quality oil were discovered at Dukhan in 1940, but full-scale exploitation did not begin until 1949.
In 1960, Sheikh Ahmad bin 'Ali al-Thani succeeded his father, who had become too old to rule effectively. Social and economic development during the subsequent decade was disappointing, especially in view of the increasing availability of oil revenues. In January 1968, the United Kingdom announced its intention to withdraw its forces from the Persian Gulf States by the end of 1971. Discussions took place among the Trucial States, Bahrain, and Qatar, with a view to forming a federation. The Trucial States formed the United Arab Emirates, but Qatar could not agree to the terms of the union. On 3 September 1971, the independent State of Qatar was declared. A new treaty of friendship and cooperation was signed with the United Kingdom, and Qatar was soon admitted to membership in the Arab League and the UN.
On 22 February 1972, Sheikh Khalifa bin Hamad al-Thani, the deputy emir and prime minister, seized power in a peaceful coup, deposing his cousin, Sheikh Ahmad. Since his accession, Sheikh Khalifa pursued a vigorous program of economic and social reforms, including the transfer of royal income to the state. On 31 May 1977, Sheikh Khalifa appointed Sheikh Hamad bin Khalifa al-Thani, his son, as heir apparent and minister of defense.
In 1981, Qatar, along with the other Persian Gulf states of Bahrain, Kuwait, Oman, Sa'udi Arabia, and the United Arab Emirates, established the Gulf Cooperation Council (GCC). The GCC attempted to mediate the war between Iran and Iraq, which had erupted in September 1980, but at the same time gave support to Iraq. Qatar's boundary disputes with Bahrain disrupted relations between the two countries in the mid-1980s. In 1991, they agreed to refer their dispute over the Hawar Islands to the International Court of Justice at The Hague. In 1992, there was a minor clash between Qatari and Sa'udi troops over a disputed border. That quarrel was resolved with a boundary agreement signed in Cairo in December 1992.
Qatari forces, although small in size, are active in the collective defense of the GCC and played a helpful role on the allied side in the Gulf War against Iraq.
In 1995, Sheikh Hamad seized power from his father amid a turbulent and secretive attempted coup in February of that year by unknown forces. Sheikh Khalifa, the aging ruler, had spent much of his time before being ousted sailing the Mediterranean on the royal yacht. Also a problem was the aging emir's eccentric method of funding the government, which was to siphon off half of the revenue generated from the country's oil into his personal bank accounts, and pay for government services from those funds. In the late 1980s and early 1990s, the emir felt less inclined to withdraw money than to deposit, and the resulting revenue drain was crippling the economy. When Sheikh Hamad took control of the government, while his father was away on business, the now former emir froze his personal bank accounts, which held, essentially, Qatar's treasury. Estimates of Sheikh Khalifa's personal accounts range from $4–$30 billion.
In 1996, the former emir set up a government in exile in the United Arab Emirates. The hostile transfer of power led to friction among the normally contention-free members of the GCC. Also that year, Sheikh Hamad issued writs demanding that his father turn over control of his assets to the state. Initially, the emir had resigned himself to the loss of revenue, but severe budget constraints caused him to cut government spending and, in order to develop the huge off-shore natural gas reserves the country will rely on in the future, huge infrastructure expenses needed to be made.
In 1999, the former emir still claimed to be the legitimate ruler of Qatar, and his allies within the ruling elite were still a source of problems for Sheikh Hamad. However, Sheikh Hamad has
continued to rule and implement change in spite of outside threats.
In 1999, Qatar supported the Organization of Oil Exporting Countries (OPEC) efforts to increase oil prices by cutting back crude oil production from March 1999 to April 2000. Qatar was also practicing fiscal discipline and creating low-cost efficiencies. The government was developing a tariff structure with a monthly ceiling on water and electricity services, previously free of charge. In addition, plans were in the works to implement a foreign investment code in agriculture, industry, tourism, and education ventures.
Perhaps most striking, Sheikh Hamad was encouraging political openness. In 1999, women voted and ran for office in municipal elections for the first time. A constitutional committee was charged with drawing up a permanent constitution under which Qatar would have an elected parliament. Political openness was even extended to the media as Qatar's satellite news channel, Al Jazeera, broke a previous taboo with an open discussion and criticism of the state funding of the ruling family.
On 16 March 2001, the International Court of Justice (ICJ) resolved a territorial dispute between Bahrain and Qatar over the potential oil-and gas-rich Hawar Islands. The islands were controlled by Bahrain since the 1930s but were claimed by Qatar. Bahrain also claimed the town of Zubarah, which is on the mainland of Qatar. The dispute has lasted for decades and almost brought the two nations to the brink of war in 1986. In its judgment, the ICJ drew a single maritime boundary in the Gulf of Bahrain, delineating Bahrain and Qatar's territorial waters and sovereignty over the disputed islands within. The ICJ awarded Bahrain the largest disputed islands, the Hawar Islands, and Qit'at Jaradah Island. Qatar was given sovereignty over Janan Island and the low-tide elevation of Fasht ad Dibal. The Court reaffirmed Qatari sovereignty over the Zubarah Strip.
During 2002 and into 2003, Qatar, along with the other countries of the Persian Gulf, were confronted with the situation of a potential US-led war with Iraq. On 8 November 2002, the UN Security Council unanimously passed Resolution 1441, calling on Iraq to immediately disarm itself of weapons of mass destruction (WMD) and WMD weapons capabilities, to allow the immediate return of International Atomic Energy Agency (IAEA) and UN weapons inspectors, and to comply with all previous UN resolutions regarding the country since the end of the Gulf War in 1991. If Iraq was found to be in "material breach" of the resolution, "serious consequences" were to result. The United States and the United Kingdom began amassing troops in the region, and by the end of February 2003, the number of troops in the Persian Gulf was approximately 200,000. As of 1 February, there were approximately 3,500 US military personnel in Qatar. In December 2002, a computer-assisted exercise entitled "Internal Look" was carried out in Qatar, involving approximately 1,000 military planners and a mobile command center, which would eventually be staffed by 1,600 US and UK troops. As of March 2003, an aerial command-and-control center was being constructed at Al Udeid, in the event that US forces could not use their control center in Sa'udi Arabia. The Al Udeid air base has the longest runway in the Gulf region (approximately 5,000 m/15,000 ft), and can accommodate nearly 100 aircraft. Operating at Al Udeid in early 2003 was air-to-air refueling of tanker aircraft in support of US-led forces in Afghanistan and to patrol Iraq's southern no-fly zone in the aftermath of the 1991 Persian Gulf War. In December 2002, the United States and Qatar signed a bilateral defense agreement that US Secretary of Defense Donald Rumsfeld stated was not connected to Iraq.
However, Qatar has said it would not act in a conflict with Iraq without UN approval. At an Arab League summit held at Sharm el-Sheik, Egypt, on 1 March, sharp divisions between Arab leaders on the Iraq situation emerged, particularly between Libya and Sa'udi Arabia. However, the leaders issued a declaration expressing "complete rejection of any aggression on Iraq," and called for continuing UN weapons inspections. It also called upon Iraq to disarm itself of WMD and the missiles needed to deliver them. At the summit, some leaders argued war was inevitable and that the countries of the region should prepare for its aftermath; some argued that war could be avoided if Iraq were to comply with weapons inspections; and a third group argued that the summit should issue an unequivocal anti-war declaration.