The history of Bahrain has been traced back 5,000 years to Sumerian times. Known as Dilmun, Bahrain was a thriving trade center around 2000 BC ; the islands were visited by the ships of Alexander the Great in the third century BC . Bahrain accepted Islam in the 7th century AD , after which it was ruled alternately by its own princes and by the caliphs' governors. The Portuguese occupied Bahrain from 1522 to 1602. The present ruling family, the Khalifa, who are related to the Sabah family of Kuwait and the Sa'udi royal family, captured Bahrain in 1782. Following an initial contact in 1805, the ruler of Bahrain signed the first treaty with Britain in 1820. A binding treaty of protection, similar to those with other Persian Gulf principalities, was concluded in 1861 and revised in 1892 and 1951. After World War II, Britain maintained at Bahrain its headquarters for treaty affairs in the lower Gulf. Claims to Bahrain pressed by Iran were abandoned in 1971 after a UN mission ascertained that the Bahrainis wished to remain independent of that nation.
Between 1968 and 1971, Bahrain participated in discussions aimed at forming a federation of the nine sheikhdoms of the southern Gulf. On 14 August 1971, Sheikh 'Isa bin Salman al-Khalifa declared that, in view of the failure of the larger federation to materialize, Bahrain would declare its independence. Its treaties with the United Kingdom were replaced by a treaty of friendship and cooperation, and on 15 August, the country became the sovereign State of Bahrain. Bahrain promulgated its first constitution in 1973, which occasioned the convening of an elective National Assembly; the legislature was dissolved in August 1975 amid charges of communist influence. The emir continued to set state policy, and his brother, Crown Prince Hamad bin 'Isa al-Khalifa, directed government administration. In 1993, Bahrain established an appointive Consultative Assembly (Majlis al-Shura). On 14 February 2001, a referendum was held that endorsed a return to constitutional rule. Under the constitution amended 14 February 2002, the country is no longer an emirate, but a constitutional monarchy. The emir was replaced by a king. A two-house National Assembly was established, along with an independent judiciary.
Owing to its small size, Bahrain generally takes its lead in foreign affairs from its Arab neighbors on the Gulf. A founding member of the Gulf Cooperation Council, it shares with the other five members a long-standing concern with pressures from Iran and Iraq. During the Iran-Iraq War, Bahrain joined most other Arab states in supporting Iraq. Subsequently, it has carefully tried to foster better relations with Iran through trade. When Iraq invaded Kuwait, Bahrain stood with the allies, contributing military support and facilities to the defeat of Iraq.
Bahrain has long assisted the American naval presence in the Persian Gulf. In 1977, a formal agreement for home-porting US naval ships was replaced by arrangements to continue ship visits and other security cooperation. Since the Gulf War, this cooperation has expanded with arms sales, plans for joint exercises and US pre-positioning of military material for future contingencies. In 1991, the United States signed an agreement giving the Department of Defense access to facilities on the island. The country is home to the US Navy's Fifth Fleet.
Since 1994, Bahrain, like several traditional emirates of the Gulf, experienced sometimes severe civil disturbances from a Shi'ite-led resistance opposed to the ruling family and supportive of establishing an Islamic democracy. In 1996, a band of 44 Bahraini Islamists were arrested for allegedly planning a coup to overthrow the ruling family. The emirate broke relations with Iran, which the former accused of fomenting its civil disturbances which between 1994 and 1996 had resulted in 25 deaths. In 1997, the United States disclosed that it had uncovered a plot to attack its military forces stationed in the country.
On 6 March 1999, Sheikh 'Isa bin Salman al-Khalifa, who had ruled his country since its independence in 1971, died of a heart attack. He was succeeded on the throne by his son, Sheikh Hamad bin 'Isa al-Khalifa. Over the following year, there were signs that while the new ruler would continue his father's pro-Western foreign-policy orientation, domestically he would take a more liberal approach to government. In April, Sheikh Hamad released high-profile Shi'ite dissident, Sheik Abdul Amir al-Jamri, from jail together with hundreds of other political prisoners. Another broad pardon of dissidents took place in November. By February 2001, the emir had pardoned and released all political prisoners, detainees, and exiles.
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.
In August 2002, Hamad (now king) made the first state visit to Iran since the Islamic revolution in 1979. The two countries voiced their support for solidarity with the Iraqi people. Iraq was at that time under the threat of a military attack led by the United States for its possession of weapons of mass destruction. Bahrain and Iran urged Iraq to implement all UN resolutions then pending, so that Iraq's territorial integrity and sovereignty could be honored. President Mohammed Khatami of Iran and King Hamad also noted the importance of preserving security and stability in the region, and thus pledged to strengthen ties with one another. Several trade, taxation, and naval agreements were signed at the conclusion of the state visit. As well, both countries agreed to "open a new page" in their bilateral relations, previously strained due to Iran's support for Bahraini opposition movements, and Iran's criticism of the American military presence in Bahrain.
In January 2003, demonstrations took place in Bahrain in opposition to a potential US-led war with Iraq. By 13 January, there were approximately 150,000 US troops in the Gulf region, many of which were stationed in Bahrain, in addition to Kuwait, Qatar, Sa'udi Arabia, and Oman.