Taif is a city in the Mecca Province of Saudi Arabia at an elevation of 1,879 m (6,165 ft) on the slopes of the Sarawat Mountains (Al-Sarawat Mountains). It has a population of 521,273 (2004 census). Each summer the Saudi Government moves from the heat of Riyadh to Ta'if. The city is the centre of an agricultural area known for its grapes, pomegranate, figs, roses and honey.
The inhabitants of Ta'if, are largely made up of the Hanbali and Maliki Sunnis Saudi Arabians. There are also significant foreign populations, primarily from Asia, Turkey, and other Arab countries.
In the 6th century the city of Tā'if was dominated by the Banu Thaqif tribe( Thaqif tribe still lives in and around the city of Taif today)
The town is about 100 km (62 mi) southeast of Mecca. The walled city was a religious centre as it housed the idol of the goddess Allāt, who was then known as "the lady of Tā'if." Its climate marked the city out from its dry and barren neighbours closer to the Red Sea. Wheat, vines, and fruit were grown around Tā'if and this is how the city earned its title "the Garden of the Hejaz."
During the Year of the Elephant, this city was involved in the events.
Both Ta'if and Mecca were resorts of pilgrimage. Ta'if was more pleasantly situated than Mecca itself and the people of Ta'if had close trade relations with the people of Mecca. The people of Ta'if carried on agriculture and fruit‑growing in addition to their trade activities.
620 – 632: Muhammad's era
630: The Battle of Hunayn and the Conversion of the City
In 630, the Battle of Hunayn took place at Hunayn, close to this city. Shortly after that, the unsuccessful Siege of Ta'if took place. The city was assaulted by catapults from Banu Daws, but it repelled the attacks. The Battle of Tabouk in 631 left Tā'if completely isolated so members of Thaqīf arrived in Mecca to negotiate the conversion of the city to Islam. The idol of Al-lāt was destroyed along with all of the other signs of the city's previously pagan existence.
1517: Surrender to the Ottoman Empire
On 17 July 1517 the Sharif of Mecca capitulated to the Ottoman Sultan Selim I. As a sign of this, he surrendered to him the keys of the Islamic cities of Mecca and Medina. As part of the Hejaz, Ta'if was also given over to Ottoman control.
1802 – 1813: Retaking by the Saudi and reconquest by the Ottomans
The city remained Ottoman for a further three centuries, until in 1802 it was retaken by Saudi revolt, who were in alliance with the House of Saud. These forces then proceeded to take Mecca and Medina. The loss was keenly felt by the Ottoman Empire, which viewed itself as the protector of the Holy Cities. The Ottoman Sultan, Mahmud II, called upon his nominal Viceroy in Egypt Muhammad Ali, who launched an attack on the Hejaz and reconquered Ta'if in 1813.
1813: Johann Ludwig Burckhardt
In 1813, the Swiss traveller and orientalist Johann Ludwig Burckhardt visited Ta'if. He has left an eyewitness account on the city just after its recapture by the Muhammad Ali, with whom he obtained several interviews while he was there. Burckhardt says that the wall and ditch around the city had been built by Othman el Medhayfe. There were three gates and several towers on the city walls, which, however, were weak, being in some places only 45 cm (18 in) thick. Burckhardt says that the castle had been built by Sharif Ghalib. He notes the destruction of the city caused by the conquest of 1802. Most of the buildings were still in ruin while he was there and the tomb of [Abdullah ibn Abbas]Radi Allah Ho unhu – cousin of Muhammad and ancestor of the Abbasid Caliphate – had been severely damaged. He also records that the population of the city is still mostly Thaqīf. In terms of trade, the city was an entrepôt for coffee.