What's behind the rise of terrorism in India--and why it won't end soon.

In the wake of the coordinated terror attacks this week in Mumbai, many Indian and Western observers seemed shocked by the brutality and skill of the attackers. But the terror strikes should not have come as such a surprise. After years of largely avoiding the kind of sophisticated Islamist terror that has been the hallmark of Al Qaeda, in the past year India has become, as much as Europe or the United States, a frontline in the global war on terror.

Until the past year, India, though often wracked by communal Muslim-Hindu violence, mostly had escaped coordinated terror attacks by groups like Al Qaeda offshoots--attacks that were highly sophisticated and also specifically targeted foreigners, the calling cards of Al Qaeda and its offshoots. (To be sure, Mumbai suffered attacks, like bombs placed in railway stations and trains in 2006, but none that targeted foreigners or involved sophisticated planning.)

In part, this was because there had been little radical infiltration of most Indian mosques. India's Muslims historically practiced a moderate, syncretic form of the faith, and for years Persian Gulf-based radicals groups found little welcome in the Indian Muslim community. Indian terror experts I know did not, until recently, believe Al Qaeda had established any kind of footprint in the country.

That has changed. In just the last few months, an allegedly homegrown terror network called the "Indian Mujahedeen" claimed responsibility for launching strikes in Delhi, Bangalore, and other cities. In the September Delhi attack, another sophisticated strike with coordinated bombings, 24 people were killed and more than 100 injured. Strikingly, several of the men arrested in one bust of this group were middle-class Muslims, including a software engineer. After one attack, the Mujahedin made clear that they were homegrown, declaring in a message that their strike was "planned and executed by Indians only,"

After years of moderation, India's Muslims--including even some middle-class Muslims--finally may be striking back at the discrimination stacked against them, creating space for them to at least be inspired by Al Qaeda. Though a few Muslims have risen up in society, like the previous Indian president, Abdul Kalam, overall India’s 150 million Muslims remain a permanent underclass. One national survey taken in 2006 discovered that Muslims consistently lag behind their Hindu peers in earned income, education, and other signs of progress. The study further found that Muslims have been sliding down the social ladder in recent years, and now face discrimination that some have concluded is comparable to that faced by India's notorious Dalits, or "untouchables."

At the same time, radical Hindu organizations, who long have targeted Muslims--they have been involved in several notorious anti-Muslim pogroms--have become more sophisticated themselves, and are launching strikes against Muslim targets. This month, in fact, the Indian government arrested members of a Hindu terrorist organization for the first time.

After blaming Pakistan for nearly every previous attack, India's prime minister recently admitted the threat had changed. "The role of Pakistan-based terrorist groups cannot be minimized, but the involvement of local elements in recent blasts adds a new dimension to the terrorist threat," he declared. As Newsweek recently reported, terrorist groups already have set up paramilitary training camps in remote parts of India to train hundreds of local radicals.

Homegrown radicals also are proving a tougher challenge for the police, making more attacks likely. Until now, India's security forces had been relatively effective in hunting down terror groups, since many were crossing into India from Pakistan, making them easier to track by the army, which is more sophisticated than the police in counterterror operations. Infiltrating India-based organizations will be much harder, especially since the police force is notoriously short of high-ranking Muslim investigators who might be able to gather intelligence on local jihadis--Mumbai police apparently had no intelligence on the brazen attacks this week.

With an Indian election approaching, a natural time for militants to make a statement, there's little reason to believe the Mumbai killings were the last attack. The first foreign-policy crisis of the Obama administration may have arrived early.

Joshua Kurlantzick is a special correspondent for The New Republic.

By Joshua Kurlantzick