As Pakistan became more closely allied with the United States in the war on terrorism, it found itself facing attacks at home. At the same time, the military government of President General Pervez Musharraf encountered mounting criticism for not giving up control to a civilian administration.
The abduction and murder of American journalist Daniel Pearl in January was the first blow in a year of unprecedented violence against foreigners and Christians in Pakistan.
After the September 11, 2001, terror strikes in the United States, President Pervez Musharraf abandoned ties with Afghanistan's Taleban regime and joined the U.S.-led anti-terrorism forces. The president banned extremist Islamic groups at home.
Pakistan intelligence agencies have been tracking down al-Qaida and Taleban fugitives, rounding up more than 400 suspected militants. Many were handed over to U.S. custody.
The military government was rewarded for those efforts with better relations with the world community, particularly the United States.
It won crucial financial assistance and debt adjustments, in return for what U.S. officials called excellent cooperation in the war on terrorism. Senior American officials have visited Pakistan all year to strengthen ties.
Deputy Secretary of State Richard Armitage was among the visitors and praised Islamabad's antiterrorism efforts. "We think they are doing a splendid job in very difficult tribal areas," he said. "We are quite delighted with the activities and very complimentary of them."
But President Musharraf's new policies were not so well received at home. Instead, many hardline Muslims feel betrayed and have lashed out.
In March, assailants threw grenades into an international Protestant church, killing five people including a U.S. embassy employee and her 17 year old daughter.
A couple of months later, a suicide bomber in the southern city of Karachi killed 11 French engineers and three others. A later attack on an American consulate left 12 Pakistanis dead.
President Musharraf told the United Nations in September the attacks have not lessened Pakistan's resolve to root out terrorists. "We have interdicted infiltration by al-Qaida into Pakistan," Mr. Musharraf said. "We have arrested and deported foreign suspects found on our territory. We are determined not to allow any one to use our soil for terrorist acts inside or outside Pakistan."
At home, President Musharraf, who took office in a 1999 coup, has been busy fending off political criticism over constitutional changes he made to enhance his powers. Although he pledged to return Pakistan to democracy, he gave himself the power to remove an elected government, and he extended his term in office by five years.
Opposition parties called the changes undemocratic. They also charged that the national elections in October were rigged in favor of the pro-Musharraf Pakistan Muslim League.
International election observers, such as John Cushnahan with the European Union delegation, supported the allegations. "Regrettably, the Pakistan authorities engaged in a course of action which resulted in serious flaws in the electoral process," Mr. Cushnahan said.
Even after the elections and the selection of a new prime minister, the criticism has continued. "A change of face has taken place, democracy has not yet come. I mean by name, yes, but actual democracy, no," said Tahmina Daultana, an opposition politician. "There should be not just change of face, there should be actual democracy in the country. And for that it is important that the power should lie with the elected people of Pakistan."
President Musharraf may find himself fending off another political challenge in the coming months.
In October's election, an alliance of Islamic parties stunned observers by winning 60 seats in the National Assembly, up from just three seats in the last election. The alliance, known as MMA, tapped opposition to the U.S. military action in Afghanistan and to President Musharraf's backing for Washington.
The Islamic alliance won an outright majority in the Northwestern Frontier province and performed strongly in Balochistan province. Both border Afghanistan.
"Look at the irony of it," said Ayaz Amir, a leading political commentator and columnist. "Here was this liberal general supposed to roll back Pakistan from the frontiers of religious extremism and look at how things have happened, that under his aegis this new thing is growing, which is a troubling portent for Pakistan."
Among other things, the religious parties want U.S. soldiers and intelligence agents expelled from Pakistan and want Islamic law implemented in the country. But the newly elected government vows to continue supporting the U.S.-led war on terrorism.