Islam in Afghanistan began to be practiced after the Arab Islamic conquest of Afghanistan from the 7th to the 10th centuries, with the last holdouts to conversion submitting in the late 19th century. Today, Islam is the official state religion of Afghanistan, with approximately 99.8% of the Afghan population being Muslim. About 80-90% practice Sunni Islam, belonging to the Hanafi Islamic law school, while 7-20% are believed to be Shias. Most Shias (Shiites) belong to the Twelver branch and only a smaller number follow Ismailism.
During the 7th century, the Rashidun Caliphate Arabs entered modern-day Afghanistan after decisively defeating the Sassanian Persians in Nihawand. Following this colossal defeat, the last Sassanid Emperor, Yazdegerd III, who became a hunted fugitive, fled eastward deep into Central Asia. In pursuing Yazdegerd, the route the Arabs selected to enter the area was from north-eastern Iran and thereafter into Herat, where they stationed a large portion of their army before advancing toward northern Afghanistan.
A large number of the inhabitants of northern Afghanistan accepted Islam through Umayyad missionary efforts, particularly under the reign of Hisham ibn Abd al-Malik and Umar ibn AbdulAziz. In south, Abdur Rahman bin Samara introduced Islam to the natives of Zabulistan which was ruled by the Zunbils.