The United Arab Emirates was formed from the group of tribally organized Arabian Peninsula sheikhdoms along the southern coast of the Persian Gulf and the northwestern coast of the Gulf of Oman. The area accepted Islam in the 7th century; it was famous for being home to many companions of the Islamic Prophet Muhammad.

Later, portions of nation came under the direct influence of the Ottoman Empire during the 16th century. Thereafter the region was known as the Pirate Coast, as raiders based there harassed the shipping industry, despite both European and Arab navies patrolled the area from the 17th century into the 19th century. British expeditions to protect the Indian trade from raiders at Ras al-Khaimah led to campaigns against that headquarters and other harbors along the coast in 1819. The next year, a peace treaty was signed to which all the sheikhs of the coast adhered. Raids continued intermittently until 1835, when the sheikhs agreed not to engage in hostilities at sea. In 1853, they signed a treaty with the United Kingdom, under which the sheikhs (the "Trucial Sheikhdoms") agreed to a "perpetual maritime truce." It was enforced by the United Kingdom, and disputes among sheikhs were referred to the British for settlement.

Primarily in reaction to the ambitions of other European countries, the United Kingdom and the Trucial Sheikhdoms established closer bonds in an 1892 treaty, similar to treaties entered into by the UK with other Persian Gulf principalities. The shaikhs agreed not to dispose of any territory except to the United Kingdom and not to enter into relationships with any foreign government other than the United Kingdom without its consent. In return, the British promised to protect the Trucial Coast from all aggression by sea and to help out in case of land attack.

In 1955, the United Kingdom sided with Abu Dhabi in the latter's dispute with Oman over the Buraimi Oasis and other territory to the south. A 1974 agreement between Abu Dhabi and Saudi Arabia would have settled the Abu Dhabi-Saudi border dispute; however, the agreement has yet to be ratified by the UAE Government and is not recognized by the Saudi Government. The border with Oman also remains officially unsettled, but the two governments agreed to delineate the border in May 1999.

In 1968, the UK announced its decision, reaffirmed in March 1971, to end the treaty relationships with the seven Trucial Sheikhdoms which had been, together with Bahrain and Qatar, under British protection. The nine attempted to form a union of Arab emirates, but by mid-1971 they were unable to agree on terms of union, even though the termination date of the British treaty relationship was the end of 1971. Bahrain became independent in August and Qatar in September 1971. When the British-Trucial Shaikhdoms treaty expired on December 1, 1971, they became fully independent. On December 2, 1971, six of them entered into a union called the United Arab Emirates. The seventh, Ras al-Khaimah, joined in early 1972.