Ancient Armenian literary sources almost always give the name of the ancient city of Dvin as Dwin or Duin. Later authors favored the Dvin appellation, which is the most common form given in scholarly literature. The word is of Middle Iranian origin, and means hill.
The ancient city of Dvin was built by Khosrov III of Armenia in 335 on a site of an ancient settlement and fortress from the 3rd millennium BC. Since then, the city had been used as the primary residence of the Armenian Kings of the Arsacid dynasty. Dvin boasted a population of about 100,000 citizens in various professions, including arts and crafts, trade, fishing, etc.
After the fall of the Armenian Kingdom in 428, Dvin became the residence of Sassanid appointed marzpans (governors), Byzantine kouropalates and later Umayyad- and Abbasid-appointed ostikans (governors), all of whom were of senior nakharar stock. Under Arsacid rule, Dvin prospered as one of the most populous and wealthiest cities east of Constantinople. Its prosperity continued even after the partition of Armenia between Romans and Sassanid Persians, when it became the provincial capital of Persian Armenia, and eventually it became a target during the height of the Muslim conquests. According to Sebeos and Catholicos John V the Historian, Dvin was captured in 640 during the reign of Constans II and Catholicos Ezra. During the Arab conquest of Armenia, Dvin was captured and pillaged in 640, in the first raids. On January 6, 642 the Arabs stormed and took the city, slaughtered 12,000 of its inhabitants and carried 35,000 into slavery. Dvin became the center of the province of Arminiya, the Arabs called the city Dabil.
Although Armenia was a battleground between Arabs and Byzantine forces for the next two centuries, in the 9th century it still flourished. Frequent earthquakes and continued warfare led to the decline of the city from the beginning of the 10th century. During a major earthquake in 893, the city was destroyed, along with most of its 70,000 inhabitants.
Following a devastating Daylamite raid in 1021, which sacked the city, Dvin was captured by the Shaddadids of Ganja, and ruled by Abu'l-Aswar Shavur ibn Fadl, who successfully defended it against three Byzantine attacks in the latter half of the 1040s.
In 1064, the Seljuks occupied the city. The Shaddadids continued to rule the city as Seljuk vassals until the Georgian King George III conquered the city in 1173. In 1201-1203, during the reign of Queen Tamar, the city was again under Georgian rule. In 1236, the city was completely destroyed by Mongols.
Dvin was the birthplace of Najm ad-Din Ayyub and Asad ad-Din Shirkuh bin Shadhi, Kurdish generals in the service of the Seljuks; Najm ad-Din Ayyub's son, Saladin, was the founder of the Ayyubid dynasty. Saladin was born in Tikrit, Iraq, but his family had originated from the ancient city of Dvin.