structural:reformatting, information:filtering
Origins in Arabia

The ghazal originated in Arabia in the 7th century, evolving from the qasida, a much older pre-Islamic Arabic poetic form. Qaṣīdas were typically much longer poems, with up to 100 couplets. Thematically, qaṣīdas did not include love, and were usually panegyrics for a tribe or ruler, lampoons, or moral maxims. However, the qaṣīda's opening prelude, called the nasīb, was typically nostalgic and/or romantic in theme, and highly ornamented and stylized in form. In time, the nasīb began to be written as standalone, shorter poems, which became the ghazal.

The ghazal came into its own as a poetic genre during the Umayyad era (661–750) and continued to flower and develop in the early Abbasid era. The Arabic ghazal inherited the formal verse structure of the qaṣīda, specifically, a strict adherence to meter and the use of the qafiya, a common end rhyme on each couplet (called a bayt in Arabic and a sher in Persian).

The nature of the ghazals also changed to meet the demands of musical presentation, becoming briefer in length. Lighter poetic meters, such as khafîf, ramal, and muqtarab were preferred, instead of longer, more ponderous meters favored for qaṣīdas (such as kâmil, basît, and rajaz). Topically, the ghazal focus also changed from nostalgic reminiscences of the homeland and loved ones, towards romantic or erotic themes. These included sub-genres with themes of courtly love (udharî), eroticism (hissî), homoeroticism (mudhakkar), and as a highly stylized introduction to a larger poem (tamhîdî).

During the Umayyad and early Abbasid eras, the ghazal blossomed. It inherited the structure of the qaṣīda, focusing on meter and end rhymes. With time, it adapted for musical presentation, becoming shorter. Lighter meters were preferred, and themes shifted towards romance and eroticism.