ISLAMABAD, Pakistan, April 26 -- Every spring, the Margalla Hills overlooking this capital city burst into life. Evening thunderstorms send torrents of water down the slopes, scenic paths attract hikers and picnickers, and bands of monkeys scramble down from the trees to watch the weekend visitors.

But this season, the forested ridges have taken on a new, ominous significance for jittery residents. Suddenly, the hills are being depicted as the last barrier to hordes of Islamist insurgents sweeping south from the Afghan border and as perfect places for suicide bombers to lurk.

"If the Taliban continue to move at this pace, they will soon be knocking at the doors of Islamabad. The Margalla Hills seem to be the only hurdle in their march toward the federal capital," Maulana Fazlur Rehman, a religious party leader, warned last week in a speech to Parliament. He was exaggerating for effect, but the image struck home.

Islamabad, a placid, park-filled city of 1.5 million people, was built in the 1960s as a symbol of Pakistan's modern and democratic aspirations. Its boulevards are lined with grandiose federal buildings, and its shady side streets are home to an elite class of politicians and professionals. Until several years ago, the orderly capital seemed immune to the religious violence that bedeviled the country's wilder rural fringes.

But now, a psychosis of fear has gripped the Pakistani capital, driven partly by recent televised images of turbaned Taliban fighters occupying town after town in the northwest districts of Swat, Shangla and Buner -- as close as 60 miles from Islamabad -- and partly by a rash of bombings and threats in the quiet, heavily policed federal district.

Private schools that cater to international and wealthy families have installed security cameras and gun turrets; many are losing foreign students as embassies and agencies send families home. The local World Bank office just moved into the heavily guarded Serena Hotel.

Police barricades, detours and checkpoints are sprouting so fast that drivers barely have time to learn the new traffic patterns. Without a foreign passport or a VIP license plate, it is almost impossible to enter the federal district that includes the Supreme Court, the Parliament and the diplomatic enclave.

"We're not going to let anyone come and capture Islamabad, but we have too few resources to secure the city," said Nasir Aftab, the superintendent of police, his eyes red after a night of little sleep. "We need more weapons and men. We need explosive detectors and vehicle scanners on the highway entrances. If a mullah tells a boy of 15 to blow himself up, how do you stop him? This is the capital, and we don't even have a sniffer dog."

It is the insidiousness of suicide bombers, more than the bravado of gun-toting Taliban troops, that keeps officials such as Aftab up at night. The biggest bombing yet here was in September, when a truck full of explosives rammed into the luxury Marriott Hotel, killing 52 people.

The hotel has since reopened, and the lobby has been restored to its former elegance. But the inviting scene is hidden behind blast walls, and the doormen who once swept open wide glass portals guard a narrow opening with a huge metal detector.

"Sometimes I think we've overdone it. The hotel looks like a fortress, but security has to be our top priority," said Zulfikar Ahmed, the Marriott's general manager. He said hotel occupancy had plunged to 40 percent of what it once was. "We maintain a calm atmosphere, but if something happens tomorrow, it will drop again," he said.

A less spectacular but equally worrisome attack occurred last month, when a young man approached an open camp for off-duty paramilitary guards, located in a small park in an upper-class residential area. The man blew himself up, killing himself and five guards.

The blast sent shoppers fleeing in panic from the exclusive Jinnah Market a few blocks away. Now, the market is half-empty, waiters stand idle and merchants sit behind sale racks on the sidewalk.

"The future looks very bleak. Fear chases us everywhere, from the moment we leave home to the moment we return at night," said Mohammed Ismael, 46, who sells fabric for party dresses. "These blasts and attacks don't hurt the ruling class, but they destroy our business. . . . The tension is everywhere."

The tension is relatively new to Islamabad, which until 2007 had been tranquil. But that summer, the calm was shattered by a violent face-off between the government and radical leaders of the Red Mosque, who had turned their compound in central Islamabad into an armed camp. After a standoff, security forces stormed the mosque, killing at least 100 people, and the leaders vowed revenge.

Since then, terrorist assaults, bombings and kidnappings have become regular occurrences across the country. The targets included former prime minister Benazir Bhutto, U.N. officials, NATO supply convoys, police checkpoints, video shops, mosques of minority sects, an Italian eatery in Islamabad and a Sri Lankan cricket team in Lahore.

There was also a growth in the number of religious schools, or madrassas, some of which espoused radical visions of Islam.

This month, the former chief cleric at the Red Mosque was released from detention and appeared there, nearly two years after the deadly siege. More than 5,000 people gathered to hear Maulana Abdul Aziz urge his excited followers to bring a "true Islamic system" to the nation.

"We know very little about some of these madrassas, and where their funding comes from is a mystery," said a police intelligence official.

Islamabad is far better known for its top-quality academic schools and colleges, including private institutions tailored for foreign students. Several weeks ago, police learned of terrorist threats to attack such schools and recommended that they take security measures.

The capital also houses a well-regarded national university. The student body includes thousands of women, and though more of them wear Islamic garb than before, many make clear they have no sympathy for fundamentalists.

"We've been discussing what would happen to us if the Taliban come here. Would I have to wear a burqa?" demanded Fatima Tanvir, 21, in reference to an all-covering garment. Like several of her classmates, she said she resented the negative impression many foreigners now have of her country. "People see the TV images and think we are a rogue, barbarian society. It makes us really sad," she said.

With extra contingents of paramilitary police being sent to beef up security, it seems unlikely that militant hordes will swarm down from the Margalla Hills anytime soon. But the recent attacks, and the calls to arms ringing from dozens of mosques, suggest there is more religious violence ahead.

"If they come again, we'll be ready," said an off-duty paramilitary guard in the camp that was bombed in March. Since then, the survivors have dug a trench around their tents and piled the earth into a perimeter wall. On one side are wreaths from well-wishers, and a hand-lettered sign that says, "Resist or Die."