The Pakistani city of Peshawar is reeling after one of the country’s most devastating militant attacks in years, in which 101 people died and 225 were injured after a suicide bomber hit a mosque in the city’s main police compound.

Analysts say Monday’s carnage, with most of the victims being police, is the legacy of decades of flawed policies by Pakistan and the United States.

In the 1980s, the city became the centre of the US and Pakistani scheme to back the mujahedeen fighting the Soviet invasion of Afghanistan – creating a legacy of radicalism and violence that continues until today.

Pakistan Mosque BombingPolice officers examine the site of Monday’s suicide bombing (AP)

Abdullah Khan, a senior security analyst, said: “What you sow, so shall you reap.”

He said Peshawar – once known as the “city of flowers” – was a peaceful place until the early 1980s when Pakistan’s then-dictator Ziaul Haq decided to become part of Washington’s cold war with Moscow, joining the fight against the 1979 Soviet invasion of Afghanistan.

Peshawar – less than 20 miles from the Afghan border – became the centre where the American CIA and Pakistani military helped train, arm and fund the Afghan mujahedeen fighting the Soviets.

The city was flooded by weapons and fighters, many of them hard-line Islamic militants, as well as with hundreds of thousands of Afghan refugees.

Pakistan Mosque BombingSecurity officials and rescue workers conduct an operation to clear the rubble and search for bodies at the site of Monday’s suicide bombing (AP)

Arab militants were also drawn there by the fight against the Soviets, including the scion of a wealthy Saudi family, Osama bin Laden. It was in Peshawar that bin Laden founded al-Qaida in the late 1980s, joining forces with veteran Egyptian militant Ayman al-Zawahri.

The Soviets finally withdrew in defeat from Afghanistan in 1989. But the legacy of militancy and armed resistance that the US and Pakistan fuelled against them remained.

Mahmood Shah, a former Pakistani army brigadier and a senior security analyst, said: “After the Russian withdrawal from Afghanistan in 1980s, Americans abandoned mujahedeen, Americans even abandoned us, and since then, we are paying a price for it.”

Pakistan Mosque BombingThe blast struck a mosque inside a police compound (AP)

The mujahedeen plunged Afghanistan into civil war in a bloody fight for power. Meanwhile, in Peshawar and another Pakistani city, Quetta, the Afghan Taliban began to organise, with backing from the Pakistani government.

Eventually, the Taliban took power in Afghanistan in the late 1990s, ruling until they were ousted by the 2001 American-led invasion following al-Qaida’s 9/11 attacks in the US.

During the near 20-year US war against the Taliban insurgency in Afghanistan, militant groups blossomed in the tribal regions of Pakistan along the border and around Peshawar. Like the Taliban, they found root among the ethnic Pashtuns who make up a majority in the region and in the city of two million people.

Pakistan Mosque BombingMore than 100 people were killed in the blast (AP)

Some groups were encouraged by the Pakistani intelligence agencies. But others turned their guns against the government, angered by heavy security crackdowns and by frequent US air strikes in the border region targeting al-Qaida and other militants.

Chief among the anti-government groups was the Pakistani Taliban, or Tahreek-e Taliban-Pakistani (TTP).

In the late 2000s and early 2010s, it waged a brutal campaign of violence around the country. Peshawar was scene of one of the bloodiest TTP attacks in 2014, on an army-run public school that killed nearly 150 people, most of them schoolboys.

Peshawar’s location has for centuries made it a key juncture between Central Asia and the Indian subcontinent. One of the oldest cities in Asia, it stands at the entrance to the Khyber Pass, the main route between the two regions.

Peshawar protestersPolice officers chant slogans as they take part in a peace march organised by a civil society group denouncing militant attacks (AP)

That was a source of its prosperity in trade and put it on the path of armies going both directions, from Moghul emperors to British imperialists.

A heavy military offensive largely put down the TTP for several years and the government and the militants eventually reached an uneasy truce. Peshawar came under heavy security control, with checkpoints dotting the main roads, and a heavy presence of police and paramilitary troops.

TTP attacks, however, have grown once more since the Afghan Taliban returned to power in Kabul in August 2021 amid the US and Nato withdrawal from that country.

The Pakistani Taliban are distinct from but allied to the Afghan group, and Pakistani officials regularly accuse the Afghan Taliban of giving the TTP free rein to operate from Afghan territory.

On Wednesday, several police officers joined a peace march organised by the members of civil society groups in Peshawar, denouncing militant attacks and demanding peace in the country. Police said they have made some arrests in connection with Monday’s mosque bombing, but released few details.

Ahead of Monday’s suicide bombing, Peshawar had seen increasing small-scale attacks targeting police. In another spillover from Afghanistan’s conflict, the regional affiliate of the Islamic State group attacked Peshawar’s main Shia mosque in March 2022, killing more than 60 people.

Mr Shah, the former officer, warned that more TTP attacks could follow and said that Pakistan needs to engage the Afghan Taliban and pressure them to either evict the TTP or ensure it does not launch attacks from Afghan territory.

“If we are to have peace in Pakistan, we should talk to TTP from the position of strength with help from the Afghan Taliban,” he said. “This is the best and viable solution to avoid more violence.”