ISLAMABAD, Pakistan  Pakistan moved thousands of troops into the militant stronghold of South Waziristan on Saturday, the army said, beginning a long-anticipated ground offensive against Al Qaeda and the Taliban in treacherous terrain that has stymied the army in the past.

The operation is the most ambitious by the Pakistani Army against the militants, who have unleashed a torrent of attacks against top security installations in the last 10 days in anticipation of the military assault. The militants’ targets included the army headquarters where planning for the new offensive had been under way for four months.

The United States has been pressing the army to move ahead with the campaign in South Waziristan, arguing that it is vital for Pakistan to show resolve against the Qaeda-fortified Pakistani Taliban, which now embrace a vast and dedicated network of militant groups arrayed against the nuclear-armed state. The groups include some nurtured by Pakistan to fight India.

American officials have said the fighting there would probably not substantially help the American and NATO effort in Afghanistan because most militants who cross the border to fight there are from a different area in Pakistan and because the Taliban stronghold within South Waziristan is not directly along the border.