The military history of Pakistan () covers the development, organization, and operations of the Pakistan Armed Forces from the country's creation in 1947 to the present day. Although the territory of modern Pakistan has witnessed warfare since ancient times, the history of the modern Pakistani military properly begins with the country's independence and the division of the British Indian Army.

The armed forces occupy a prominent position in the political and national history of the country. Since independence, the military has remained one of Pakistan’s most powerful institutions and has periodically intervened in politics through military coups, citing civilian mismanagement or corruption. Civilian governments have frequently consulted senior military leaders on matters of national security, particularly concerning the Kashmir conflict and foreign policy.

Since 1947, Pakistan’s armed forces have fought three major wars with India (1947–48, 1965, and 1971) and a limited conflict in Kargil in 1999, in addition to smaller border skirmishes with Afghanistan. Following the September 11 attacks, the military has been engaged in extensive counter-insurgency and counter-terrorism operations in Khyber Pakhtunkhwa and the former Federally Administered Tribal Areas, targeting the Tehrik-i-Taliban Pakistan and affiliated groups.

Pakistan has also participated in numerous international United Nations peacekeeping missions. As of 2025, Pakistan was among the top troop-contributing countries, with more than 4,000 personnel deployed in missions across Africa, Asia, and the Middle East.

550 BCE – 1857 CE

Ancient empires

The region of modern-day Pakistan (part of British Raj before 1947) formed the most-populous, easternmost and richest satrapy of the Persian Achaemenid Empire for almost two centuries, starting from the reign of Darius the Great (522–485 BC). The first major conflict erupted when Alexander the Great overthrew the Achaemenid Empire in 334 BCE and marched eastwards. After defeating King Porus in the fierce Battle of the Hydaspes (near modern Jhelum), he conquered much of the Punjab region. But his battle weary troops refused to advance further into India to engage the formidable army of the Nanda Dynasty and its vanguard of elephants, new monstrosities to the invaders. Therefore, Alexander proceeded southwest along the Indus valley. Along the way, he engaged in several battles with smaller kingdoms before marching his army westward across the Makran desert towards modern Iran. Alexander founded several new Macedonian/Greek settlements in Gandhara and Punjab.

As Alexander the Great's Greek and Persian armies withdrew westwards, the satraps left behind by Alexander were defeated and conquered by Chandragupta Maurya, who founded the Maurya Empire, which ruled the region from 321 to 185 BC. The Mauryas Empire was itself conquered by the Shunga Empire, which ruled the region from 185 to 73 BC. Other regions such as the Khyber Pass were left unguarded, and a wave of foreign invasion followed. The Greco-Bactrian king, Demetrius, capitalised and conquered southern Afghanistan and Pakistan around 180 BC, forming the Indo-Greek Kingdom. The Indo-Greek Kingdom ultimately disappeared as a political entity around 10 AD following the invasions of the Central Asian Indo-Scythians. Their empire morphed into the Kushan Empire who ruled until 375 AD. The region was then conquered by the Persian Indo-Sassanid Empire which ruled large parts of it until 565 AD.

Muslim conquests

In 712 CE, an Arab Muslim military commander called Muhammad bin Qasim conquered most of the Indus region (stretching from Sindh to Multan) for the Umayyad Empire. In 997 CE, Mahmud of Ghazni conquered the bulk of Khorasan|Khorasan]], marched on Peshawar in 1005, and followed it by the conquests of Punjab (1007), Balochistan (1011), Kashmir (1015) and Qanoch (1017). By the end of his reign in 1030, Mahmud's empire extended from Kurdistan in the west to the Yamuna river in the east, and the Ghaznavid dynasty lasted until 1187. In 1160, Muhammad Ghori conquered Ghazni from the Ghaznavids and became its governor in 1173. He marched eastwards into the remaining Ghaznavid territory and Gujarat in the 1180s, but was rebuffed by Gujarat's Solanki rulers. In 1186–87, he conquered Lahore, bringing the last of Ghaznevid territory under his control and ending the Ghaznavid Empire. Muhammad Ghori returned to Lahore after 1200 to deal with a revolt of the Rajput Ghakkar tribe in the Punjab. He suppressed the revolt, but was killed during a Ghakkar raid on his camp on the Jhelum River in 1206. Muhammad Ghori's successors established the first Indo-Islamic dynasty, the Delhi Sultanate. The Mamluk Dynasty, (mamluk means "slave" and referred to the Turkic slave soldiers who became rulers throughout the Islamic world), seized the throne of the Sultanate in 1211. Several Turko-Afghan dynasties ruled their empires from Delhi: the Mamluk (1211–1290), the Khalji (1290–1320), the Tughlaq (1320–1413), the Sayyid (1414–1451) and the Lodhi (1451–1526). Although some kingdoms remained independent of Delhi – in Gujarat, Malwa (central India), Bengal and Deccan – almost all of the Indus plain came under the rule of these large Indo-Islamic sultanates. Perhaps the greatest contribution of the sultanate was its temporary success in insulating South Asia from the Mongol invasion from Central Asia in the 13th century; nonetheless the sultans eventually lost Afghanistan and western Pakistan to the Mongols (see the Ilkhanate Dynasty).

Mughal Empire

From the 16th to the 19th century, the formidable Mughal Empire covered much of India. In 1739, the Persian emperor Nader Shah invaded India, defeated the Mughal Emperor Muhammad Shah, and occupied most of Balochistan and the Indus plain. After Nadir Shah's death, the kingdom of Afghanistan was established in 1747 by one of his generals, Ahmad Shah Abdali, and included Kashmir, Peshawar, Daman, Multan, Sindh and Punjab. In the south, a succession of autonomous dynasties (the Daudpotas, Kalhoras and Talpurs) had asserted the independence of Sind, from the end of Aurangzeb's reign. Most of Balochistan came under the influence of the Khan of Kalat, apart from some coastal areas such as Gwadar, which were ruled by the Sultan of Oman.

The Sikh Confederacy (1748–1799) was a group of small states in the Punjab that emerged in a political vacuum created by rivalry between the Mughals, Afghans and Persians. The Confederacy drove out the Mughals, repelled several Afghan invasions and in 1764 captured Lahore. However, after the retreat of Ahmed Shah Abdali, the Confederacy suffered instability as disputes and rivalries emerged. The Sikh empire (1799–1849) was formed on the foundations of the Confederacy by Ranjit Singh who proclaimed himself "Sarkar-i-Wala", and was referred to as the Maharaja of Lahore. His empire eventually extended as far west as the Khyber Pass and as far south as Multan. Amongst his conquests were Kashmir in 1819 and Peshawar in 1834, although the Afghans made two attempts to recover Peshawar.

British annexation

None of the territory of modern Pakistan was ruled by the British, or other European powers, until 1839, when Karachi, then a small fishing village with a mud fort guarding the harbour, was taken, and held as an enclave with a port and military base for the First Afghan War that soon followed. The rest of Sindh was taken in 1843, and in the following decades, first the East India Company, and then after the post-Sepoy Mutiny (1857–1858) direct rule of Queen Victoria of the British Empire, took over most of the country partly through wars, and also treaties. The main wars were that against the Baloch Talpur dynasty, ended by the Battle of Miani (1843) in Sindh, the Anglo-Sikh Wars (1845–1849) and the Anglo-Afghan Wars (1839–1919). By 1893, all modern Pakistan was part of the British Indian Empire, and remained so until independence in 1947.

After Ranjit Singh's death, the Sikh Empire was weakened by internal divisions and political mismanagement. It fell to the British in 1849 after the Second Anglo-Sikh War.

Different regions of Pakistan were conquered by East India Company as below:

Sindh was conquered by Battle of Hyderabad and Battle of Miani in 1843. Punjab and eastern Khyber Pakhtunkhwa were conquered during Second Anglo-Sikh War in 1849.

Regions conquered by British Raj are as below:

Southern Balochistan came under control by Treaty of Kalat in 1876. Western Balochistan was conquered by British empire in Second Anglo-Afghan War through Treaty of Gandamak, in 1879.

1857–1947 British Raj

Following the Indian Rebellion of 1857, control of British India passed from the East India Company to the Crown. The three Presidency armies remained separate forces, each with its own commander-in-chief. Overall operational control was exercised by the commander-in-chief of the Bengal Army, who was formally the commander-in-chief of the East Indies. From 1861 onwards, most of the officer corps' manpower was pooled in the three Presidential Staff Corps. Following the Second Anglo-Afghan War, a royal commission recommended the reorganisation of the presidency armies into one army; by then, the ordnance, supply and transport and pay branches of the three armies were already unified. In 1895, the presidency armies were merged into the British Indian Army, which was divided into four commands, including the Punjab command.

The World Wars

During World War I, the British Indian Army fought in Egypt, Palestine, Mesopotamia, Gallipoli, France, and Belgium and suffered very heavy casualties. Many troops from modern day Pakistan such as Khudadad Khan, Shahamad Khan and Mir Dast fought in France (including Flanders in modern Belgium) and received the Victoria Cross.

The British Indian Army's strength was about 189,000 in 1939. There were about 3,000 British officers and 1,115 Indian officers. The army was expanded greatly to fight in World War II. By 1945, the strength of the Army had risen to about 2.5 million men, and is considered the largest volunteer force in history. There were about 34,500 British officers and 15,740 Indian officers. The Army took part in campaigns in France, East Africa, North Africa, Syria, Tunisia, Malaya, Burma, Greece, Sicily and Italy.They helped expel Rommel from North Africa, turned back the Japanese at Imphal and helped break the Gothic line in northern Italy, thus opening a third front into Germany. The British Indian Army suffered 179,935 casualties in the war (including 24,338 killed, 64,354 wounded, 11,762 missing and 79,481 soldiers). Many future military officers and leaders of Pakistan fought in these wars.

Birth of the modern military

On 3 June 1947, the British Government announced its plan to partition British India into the independent dominions of India and Pakistan. The division of the British Indian Army was finalized on 30 June 1947, with Pakistan receiving approximately 36% of the total military establishment, corresponding to its share of population and defense requirements. This included six armoured, eight artillery, and eight infantry regiments, while India retained the remaining formations.

At the time of independence, Pakistan faced significant logistical challenges: most military infrastructure, including training centers, depots, and manufacturing facilities, were located within India. Many Pakistani troops and officers were stationed at Indian bases and had to be relocated by rail during the mass migrations and communal violence of partition. By late 1947, the newly formed Pakistan Armed Forces had around 150,000 personnel, including 2,300 officers—short of the 4,000 estimated requirement. To fill the gap, several hundred British and Commonwealth officers remained temporarily, along with volunteers from Poland and Hungary.