The co-ed Bacha Khan University in Pakistan, attacked by Islamic militants on Wednesday, was named for a prominent secular activist and ally of Mahatma Gandhi, and embodied much of what the extremists revile.

The four attackers killed 18 students and two teachers before being gunned down by security forces in an attack that revived painful memories of the assault on a nearby army-run school in Peshawar just over a year ago, which left some 150 people dead, mainly children.

The breakaway Taliban faction that claimed Wednesday's attack called the university "an instrument of the government and army," without elaborating.

The militants may have taken aim at the university because it enrolled some 450 women among its 3,000 students. Islamic extremists in Pakistan and Afghanistan are deeply opposed to the mingling of men and women outside the home, and view women's education as a pernicious Western import.

Or the attackers may have been targeting the university's namesake, Abdul Ghaffar Khan, a lifelong activist and contemporary of Gandhi who shared his commitment to nonviolent resistance of British rule and opposed the 1947 partition of India and Pakistan. The attack coincided with the anniversary of Khan's death in 1988.

Although Khan hailed from the religiously conservative northwest, he was a secular leftist sympathetic to communism, and an outspoken opponent of an earlier generation of jihadis.

Khan was against U.S. efforts to arm and fund the Afghan mujahedeen battling against the Soviet occupation in the 1980s. He later asked to be buried in Jalalabad, across the border in Afghanistan, which was then ruled by President Najibullah, a Soviet-backed communist.

But the Soviets were driven out the following year, in 1989, and Najibullah was overthrown three years later by the mujahedeen, who turned their guns on each other.

The Islamic militants killed thousands of Afghan civilians before the Taliban seized power in 1996. The Taliban, former mujahedeen who mostly hailed from southern Afghanistan, ruled until the 2001 U.S.-led invasion.

Khan's vision for Pakistan was the polar opposite of the one now being brutally pursued by the Pakistani Taliban and other militants, who have spent more than a decade battling to overthrow the government and establish an Islamic state ruled by a harsh version of Shariah law.

The founders of the university had hoped to keep Khan's ideas alive. In the aftermath of the attack, Vice-Chancellor Fazle-ur-Rahim Marwat said security forces alone could not protect the school.

"If you want to stop these attacks, you need to change the mindset," he said.