stylistic:style_transfer, structural:scholar_edition
History

Evidence of communal activity in the area around Muscat dates back to the 6th millennium BC in Ras al-Hamra, where burial sites of fishermen have been found. The graves appear to be well formed and indicate the existence of burial rituals. South of Muscat, remnants of Harappan pottery indicate some level of contact with the Indus Valley civilisation. Muscat's notability as a port was acknowledged as early as the 1st century AD by the Greek geographer Ptolemy, who referred to it as Cryptus Portus (the Hidden Port), and by Pliny the Elder, who called it Amithoscuta.

The port fell to a Sassanid invasion in the 3rd century AD, under the rule of Shapur I, while conversion to Islam occurred during the 7th century. Muscat's importance as a trading port continued to grow in the centuries that followed, under the influence of the Azd dynasty, a local tribe. The establishment of the First Imamate in the 9th century was the first step in consolidating disparate Omani tribal factions under the banner of an Ibadi state. However, tribal skirmishes continued, allowing the Abbasids of Baghdad to conquer Oman. The Abbasids occupied the region until the 11th century, when they were driven out by the local Yahmad tribe. Power over Oman shifted from the Yahmad tribe to the Azdi Nabahinah clan, during whose rule, the people of coastal ports such as Muscat prospered from maritime trade and close alliances with the Indian subcontinent, at the cost of the alienation of the people of the interior of Oman. The Portuguese admiral Afonso de Albuquerque sailed to Muscat in 1507, in an attempt to establish trade relations. As he approached the harbour, his ships were fired on. He then decided to conquer Muscat. Most of the city burned to the ground during and after the fighting.

The Portuguese maintained a hold on Muscat for over a century, despite challenges from Persia and a bombardment of the town by the Ottoman Turks in 1546. The Turks twice captured Muscat from the Portuguese, in the Capture of Muscat (1552) and 1581–88. The election of Nasir bin Murshid Al-Ya'rubi as Imam of Oman in 1624 changed the balance of power again in the region, from the Persians and the Portuguese to local Omanis. Among the most important castles and forts in Muscat, the Al Jalali Fort and the Al-Mirani Fort are the most prominent buildings left by the Portuguese. On August 16, 1648, the Imam dispatched an army to Muscat, which captured and demolished the high towers of the Portuguese, weakening their grip over the town. Decisively, in 1650, a small but determined body of the Imam's troops attacked the port at night, forcing an eventual Portuguese surrender on January 23, 1650. A civil war and repeated incursions by the Persian king Nader Shah in the 18th century destabilised the region, and further strained relations between the interior and Muscat. This power vacuum in Oman led to the emergence of the Al Bu Sa‘id dynasty, which has ruled Oman ever since.

"Muscat is a large and very populous town, flanked on both sides with high mountains and the front is close to the water's edge; behind, towards the interior, there is a plain as large as the square of Lisbon, all covered with salt pans. here are orchards, gardens, and palm groves with wells for watering them by means of swipes and other engines. The harbour is small, shaped like a horse-shoe and sheltered from every wind."

— Afonso de Albuquerque, after the fall of Muscat, in 1507.

Muscat's naval and military supremacy was re-established in the 19th century by Said bin Sultan, who signed a treaty with U.S. President Andrew Jackson 's representative Edmund Roberts on September 21, 1833. Having gained control over Zanzibar, in 1840 Said moved his capital to Stone Town, the ancient quarter of Zanzibar City; however, after his death in 1856, control over Zanzibar was lost when it became an independent sultanate under his sixth son, Majid bin Said (1834/5–1870), while the third son, Thuwaini bin Said, became the Sultan of Oman.

By the 19th century, a large Hindu merchant community in the port city dominated its commercial life. It is argued that their settlement at least since the fifteenth century; one of the reasons is that the Portuguese relied heavily on them to secure a trade monopoly in the Indian Ocean and Persian Gulf area. The Sindhis were amongst the first during this era, followed by the Kutchis. The merchant community played an important role in expelling the Europeans in 1650. They were not affected by civil war that established the Al Bu Sa‘id dynasty and continued to prosper under Ahmad bin Said al-Busaidi. Important trade existed between the city and Thatta, and later, Kutch, expanding to other parts of India.

During the second half of the 19th century, the fortunes of the Al Bu Sa‘id declined and friction with the Imams of the interior resurfaced. Muscat and Muttrah were attacked by tribes from the interior in 1895 and again in 1915. A tentative ceasefire was brokered by the British, which gave the interior more autonomy. However, conflicts among the disparate tribes of the interior, and with the Sultan of Muscat and Oman continued into the 1950s, and eventually escalated into the Dhofar Rebellion (1962). The rebellion forced the Sultan Said bin Taimur to seek the assistance of the British in quelling the uprisings from the interior. The failed assassination attempt of April 26, 1966 on Said bin Taimur led to the further isolation of the Sultan, who had moved his residence from Muscat to Salalah, amidst the civilian armed conflict. On July 23, 1970, Qaboos bin Said, son of the Sultan, staged a bloodless coup d'état in the Salalah palace with the assistance of the British, and took over as ruler.

With the assistance of the British, Qaboos bin Said put an end to the Dhofar uprising and consolidated disparate tribal territories. He renamed the country the Sultanate of Oman (called Muscat and Oman hitherto), in an attempt to end to the interior's isolation from Muscat. Qaboos enlisted the services of capable Omanis to fill positions in his new government, drawing from such corporations as Petroleum Development Oman. New ministries for social services such as health and education were established. The construction of Mina Qaboos, a new port conceived initially by Sa‘id bin Taimur, was developed during the early days of Qaboos' rule. Similarly, a new international airport was developed in Muscat's Seeb district. A complex of offices, warehouses, shops and homes transformed the old village of Ruwi in Muttrah into a commercial district. The first five-year development plan in 1976 emphasised infrastructural development of Muscat, which provided new opportunities for trade and tourism in the 1980s–1990s, attracting migrants from around the region. On June 6, 2007, Cyclone Gonu hit Muscat causing extensive damage to property, infrastructure and commercial activity.

Early photographs of the city and harbour, taken in the early 20th century by German explorer and photographer, Hermann Burchardt, are now held at the Ethnological Museum of Berlin.