Islam in Pakistan

Islam is the official religion of the Islamic Republic of Pakistan. As of 2017, 97% of the population are Muslims, with 75% being Sunni and 20% Shi'a. There are about~230 millions (2021 est.) Muslims in Pakistan which is the second largest Muslim population in the world after Indonesia. The Shi'a Muslim population is the second largest in the world after Iran, more than 60 million. Pakistan has been called a "global centre for political Islam". Pakistani nationalism is religious in nature being Islamic nationalism. Religion was the basis of Pakistani nationalist narrative.
History.
In 644 A.D. an Arab Army under the command of Hakam defeated the combined forces of Makran and Sindh, which was prominently Buddhist at the time. The period of Arab rule brought the religion of Islam to the Indus Valley. The Baloch tribes gradually embraced Islam, replacing their centuries-old Zoroastrian religion. Islam arrived in the area of modern Pakistan in 711 AD, 79 yrs after the of death of the prophet Muhammad. The Umayyad dynasty sent a Muslim Arab army led by Muhammad bin Qasim al-Thaqafi against the ruler of Sindh, Raja Dahir. Raja Dahir had given refuge to many Zoroastrian Princes who had fled the Islamic conquest of the Persian Empire. Muhammad Bin Qasim's army was defeated in his first three attempts. The Muslim army conquered the northwestern part of Indus Valley from Kashmir to the Arabian Sea. 
The arrival of the Arab Muslims to the provinces of Sindh and Punjab, along with subsequent Muslim dynasties, set the religious boundaries of South Asia. This would lead to the development of the modern state of Pakistan as well as forming the foundation for Islamic rule across much of South Asia. Following the rule of various Islamic empires, including the Ghaznavid Empire, the Ghorid Kingdom, and the Delhi Sultanate, the Mughals controlled the region from 1526 until 1739. Muslim technocrats, bureaucrats, soldiers, traders, scientists, architects, teachers, theologians and Sufis flocked from the rest of the Muslim world to Sultanate and Mughal Empire in South Asia.