Attackers sprayed gunfire and lobbed grenades into a solemn religious procession of Shiite Muslims on Tuesday, then blew themselves up as survivors scattered. Authorities said at least 42 people died, and more than 160 were wounded.

Outraged Shiite Muslims rioted after the massacre, prompting authorities to call out troops and paramilitary police to quell gunbattles and arson in this southwestern city of 1.2 million. Shiite mobs set fire to a Sunni Muslim mosque, shops and a TV station.

"Our people are not safe at home, they are not safe in mosques," said Allama Hassan Turabi, a senior Shiite leader.

The attack in Quetta came less than two hours after coordinated blasts at Shiite shrines killed more than 140 people in Iraq.

The bloodshed came on Ashoura (search), a day when Islam's Shiite faithful mark the death of a revered 7th-century leader by marching in black and lashing themselves in penitence.

Also, an accidental fire at a crowded Shiite mosque in Parachinar in northwestern Pakistan killed at least 13 women and children and injured 48 others. Officials said the fire late Tuesday was caused by an electrical short circuit.

In Pakistan, the emotional and highly visible annual rites often spark violence between the Sunni Muslim majority and Shiite minority.

Tuesday's attack was one of the deadliest in years of repeated acts of sectarian violence in Quetta. Baluchistan province, of which Quetta is the capital, holds a substantial Shiite minority that is often at odds with radical Sunni groups.

As worshippers marched through a congested neighborhood, three gunmen opened fire and hurled grenades at the crowd, said Mayor Abdul Rahim Kakar, who was nearby at the time.

Walking among the survivors with more explosives lashed to their bodies, the men blew themselves up as police moved in, Kakar said.

Two of the attackers were among the dead; the third was in critical condition.

Kakar would not reveal the identity of the men. Some suspects were being questioned in the attack, but it was not immediately clear if they were under arrest.

Hospitals put the death toll at 42. Mohammed Wasim, a doctor at the Central Government Hospital, said it received 19 bodies. The Combined Military Hospital reported taking in 23 dead.

Qamar Zaman, an assistant police inspector in Quetta, said more than 160 people were wounded, some critically.

Government officials called the carnage an attempt by extremist groups to destabilize the country. President Gen. Pervez Musharraf (search) has become an ally of the U.S. war on terrorism, earning the anger of Islamic fundamentalists. He narrowly escaped two assassination attempts in December.

"Obviously, the purpose of this attack was to create unrest," Information Minister Sheikh Rashid Ahmed told The Associated Press. "This is a very sad incident and we condemn it."

Angry Shiite Muslims quickly sought revenge. Crowds burned a Sunni mosque, partially destroying it, and set afire shops and the office of an independent television network alleged to have recently aired a talk show that included remarks slighting Shiites.

Shiite Muslims and unidentified rivals exchanged gunfire at least once in the aftermath, said Riaz Khan, Quetta's police chief.

By evening, soldiers and paramilitary police were restoring calm, Kakar said.

A Shiite leader, Abbas Kumaili, announced a three-day period of mourning throughout the country.

The attack was the largest of two deadly sectarian clashes Tuesday in Pakistan. To the north, a shootout broke out as Shiites marched in the Punjab province town of Phalia, 100 miles east of Islamabad, the capital.

Sunnis and Shiites battled, setting several houses on fire, police official Nisar Ali Shah said. At least two people -- one Sunni, one Shiite -- died, and 40 were injured, Shah said.

In July, Quetta was the site of one of the worst massacres in years in Pakistan. Attackers armed with machine guns and grenades stormed a Shiite mosque, killing 50 people praying inside. Police say a leading suspect in the July attack is the brother-in-law of Al Qaeda terrorist Ramzi Yousef (search), convicted in the 1993 bombing of the World Trade Center in New York.

Most of Pakistan's Sunnis and Shiites live peacefully together, but small radical groups on both sides are responsible for frequent attacks. Ninety-seven percent of Pakistan's population is Muslim, and Sunnis outnumber Shiites 4-to-1.