===Early history===
In the 6th century the city of Tā'if was dominatedruled by the [[Banu Thaqif]] tribe.
The town is about {{convert|100|km|mi|abbr=on}} southeast of [[Mecca]].<ref name=alislam>{{cite web|url=http://www.alislam.org/library/zafar/exampler.html |title=The Excellent Exemplar - Muhammad |publisher=Alislam.org |date= |accessdate=2012-01-17}}</ref> The walled city was a pagan religious centre. as itIt housed the idol of the goddess [[Alal-lāt|Allāt]], who was then known as "the lady of Tā'if." Its climate marked the citywas outdifferent from its dry and barren neighboursareas closer to the [[Red Sea]]. Wheat, vines, and fruit were grown around Tā'if. and this is how theThe city earned its title "the Garden of the [[Hejaz]]."
Both Ta'if and Mecca were resorts of pilgrimage. Ta'if was more pleasantly situated than Mecca itself and theThe 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.<ref name=alislam/> ▼
During the [[Year of the Elephant]], this city was involved in the events.<ref>{{cite web|url=http://www.islamawareness.net/Muhammed/saw.html |title=The Prophets of Islam - Muhammad |publisher=Islamawareness.net |date= |accessdate=2012-01-17}}</ref> ▼
▲During the [[Year of the Elephant]], thisthe city was involved in theseveral events.<ref>{{cite web|url=http://www.islamawareness.net/Muhammed/saw.html |title=The Prophets of Islam - Muhammad |publisher=Islamawareness.net |date= |accessdate=2012-01-17}}</ref>
▲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.<ref name=alislam/>
===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 (Saudi Arabia)|Hunayn]], close to this city. Shortly after that, the unsuccessfulfailed [[Siege of Ta'if]] took place. The city was assaultedattacked by catapults from [[Banu Daws]], but it survived and repelled the attacks. The [[Battle of Tabouk]] in 631 left Tā'if completely isolatedsaperated from the other ares so members of Thaqīf arrived in Mecca to negotiate the conversion of the city to Islam. The idol of Alal-lāt was destroyed along with all of theand other signs of the city's previously pagan existencepast were destroyed.<ref>{{cite book| title = Hisham Ibn Al-Kalbi - [[Book of Idols|The Book of Idols]]}}</ref><ref>{{cite book| title=[[Ibn Ishaq]] - Sīratu Rasūlu l-LāhHawting}}</ref>
====1517: Surrender to the Ottoman Empire====
On 17 July 1517 the [[Sharif of Mecca]] capitulatedgave away Ta'if to the [[Ottoman Empire|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 proceededcontinued 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 of Egypt|Muhammad Ali]], who launched an attack on the Hejaz and reconquered Ta'if in 1813.
====1813: Johann Ludwig Burckhardt====
In 1813, the [[Switzerland|Swiss]] traveller and [[Oriental studies|orientalist]] [[Johann Ludwig Burckhardt]] visited Ta'if. He has left us with an eyewitness account on the city just after itsit was taken recaptureback by the Muhammad Ali, with whom he obtained several interviews while he was there. BurckhardtAccording saysto thatBurckhardt, 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 {{convert|45|cm|abbr=on}} thick. Burckhardt says that theThe castle had been built by Sharif Ghalib. He notesalso noted 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 recordsrecorded that the population of the city iswas still mostly [[Banu Thaqif|Thaqīf]]. In terms of trade, the city was an [[entrepôt]]trading post for [[coffee]].
====1843: Building works in the 19th century====
===1916 – 1924: The Arab Revolt and Hashemite control===
[[File:Taifroad.jpg|thumb|right|Road to Ta'if in the foreground, mountains of Ta'if in the background ([[Saudi Arabia]]).]]
Prior to the [[Arab Revolt]], [[Ahmed Bey]] had been made the commander of Ottoman forces in Tā'if. He had under him a force of 3,000 soldiers and 10 guns of the mountain artillery. [[Ghalib Pasha]], the governor of the Hejaz was also present in the city. In 1916, the [[Hashemite]]s launched their revolt against the Ottoman Empire in Mecca in June. ThatThe city had fallen and then in July, [[Abdullah I of Jordan|Abdullah]], the eldest son of the Hashemite leader and Sharif of Mecca [[Husayn ibn Ali]], was sent with seventy men to Tā'if. WhilstWhile his activities in the area aroused the suspicion of Ahmed Bey, Ghalib Pasha was unconcerned by a so small a force. Abdullah secretly built up his army to 5,000 men. He then cut the telegraph wires to the city and then went on the attack. All Hashemite assaultsattacks on the city were repelled by the mountain guns, and both sides settled down to an uneasy siege. However, Hashemite guns were slowly brought up to Tā'if, and then the city held out a little longer; it finally surrendered on 22 September. The city thus later became a part of the self-proclaimed Hashemite [[Kingdom of Hejaz]].
===1924 – present: Kingdom of Saudi Arabia===
====1924: Conquest by the Ikhwan under Abdulaziz al-Saud====
{{main|Ta'if massacre}}
Ta'if did not remain in Hashemite hands for very long howevertime. Tensions between the King of the Hejaz, Husayn ibn Ali, and [[Ibn Saud of Saudi Arabia|Abdulaziz al-Saud]], Sultan of Nejd, soon broke out into violence. Although hostilities were temporarily patched up in 1919, by September 1924 the then Saudi-sponsored [[Ikhwan]] under the leadership of [[Sultan bin Bajad]] and [[Khaled bin Luwai]] was ready to attack Ta'if. The city was supposed to have been defended by the king's son, [[Ali of Hejaz|Ali]], but he fled in panic with his troops. 300 of them were slain by the Ikhwan.<ref>David Holden in ''The House of Saud''</ref> In 1926 Abdulaziz al-Saud was officially recognized as the new king of Hejaz. Ta'if remained a part of the Kingdom of Hejaz until Abdulaziz al-Saud unified his two kingdoms into one under the title of the Kingdom of Saudi Arabia in 1932. The king himself was later to die in the city on 9 November 1953.
====1940s: Modernization under the Saudis====
|