ISLAMABAD, Pakistan — Pakistan’s government on Monday rallied support for a sustained assault on Taliban fighters and other militants, as fighter jets bombed terrorist havens in North Waziristan and the army shifted manpower into major cities to help guard against retaliatory strikes.

The military operation is shaping up to be the nation’s biggest campaign against the Pakistani Taliban in at least five years. Prime Minister Nawaz Sharif authorized the move amid growing concern that Islamist militants pose an existential threat to the country.

“The army is fighting to protect the sovereignty of the motherland,” Sharif said in an address to the National Assembly on Monday night.

For years, Pakistan’s leaders have adopted a restrained approach toward the Taliban, which had found refuge in lawless tribal areas in the northwest.

But the recent attack on Karachi’s international airport, which killed 26 people and undermined the global image of Pakistan’s largest and wealthiest city, triggered the more muscular response. Sharif, who had been advocating peace talks with the Taliban, may also have been rattled by Sunni rebels’ rapid advance in northern Iraq last week, analysts say.

“Any operation or surgery is more effective when the patient is not in an emergency-like situation,” said Shahid Latif, a military analyst and retired Pakistani air force commander. “If militants could become a huge problem in Iraq, they could be equally dangerous here, so it’s better to eliminate them now before it’s too late.”

The military operation — code-named Zarb-e-Azb, after a sword used by the prophet Muhammad in an ancient battle — began Sunday with airstrikes killing 140 suspected terrorists in North Waziristan, including the alleged mastermind of the Karachi attack, officials said. Those strikes continued Monday, killing 27 suspected militants.

Tens of thousands of ground troops are also moving into the area, and military snipers have taken up positions near the towns of Mirali and Miran Shah, officials said.

During a firefight Monday evening, seven militants and two soldiers were killed, military officials said. Six soldiers also were killed by a roadside bomb earlier in the day.

A Mirali resident said he saw soldiers advance to nearby hilltops Monday. The resident, speaking on the condition of anonymity because of safety concerns, said the militants appear to be fleeing the area.

In his address, Sharif acknowledged that his peace effort had failed and said he had no choice but to authorize a war within the country’s borders.

“It is time to show unity,” he said. “Earlier, there was space for different opinions on a North Waziristan operation, but now that it has been launched, the whole nation, and especially the opposition, needs to back the government and the army.”

Most major Pakistani political parties have endorsed the operation, and on Monday it even won the support of the Movement for Justice. The party’s leader, Imran Khan, had been among the most vocal supporters of talks with the Taliban.

The united stances comes amid growing concern about the country’s stability as the U.S. military withdraws from neighboring Afghanistan.

The Pakistani Taliban — also known by the initials TTP, for Tehrik-e-Taliban Pakistan — is allied with but separate from the Afghan Taliban that is fighting U.S. forces in Afghanistan. Elements of both, along with the Afghan Haqqani network and remnants of al-Qaeda’s core leadership, are located in rugged North Waziristan.

Latif, the analyst, said the ability of the Islamic State of Iraq and Syria to quickly sweep into northern Iraq last week and come within 60 miles of Baghdad shows how dangerous a militant threat can be when left unchallenged.

“The U.S. says it’s not going to send its troops back into Iraq, so our leadership was also concerned about what will happen after NATO withdraws from Afghanistan,” Latif said.

But it remains unclear whether the Pakistani operation will be broad enough to have a major effect in a country that is home to more than three dozen militant groups.

The early stages of the operation appear aimed primarily at the Taliban and Islamist militants from Uzbekistan who have found refuge in North Waziristan.

It was not known whether the Pakistani military will also target the Haqqani network, which has been linked to attacks on U.S. troops in Afghanistan.

And even if the military dislodges the militants from North Waziristan, the porous border with Afghanistan makes it likely that many could escape.

Still, military experts are confident that Pakistan can deliver at least a serious short-term blow to the Taliban. They noted that the military largely expelled Taliban fighters from the Swat Valley in the west after several operations from 2007 to 2009.

“The North Waziristan operation may take some time, but the terrorists will be eliminated,” said Shahzad Chaudhry, a former air force commander.

For now, however, much of Pakistan is on a war footing amid concern about retaliatory strikes from the Taliban.

Shahidullah Shahid, a spokesman for the Pakistani Taliban, said in a statement that the group will target foreigners and international companies that do business in the country.

In response to the threat, the army announced Monday that it was dispatching troops to major cities on standby.

Some of the troops appear to have already taken to the streets of Karachi, with television news channels airing footage of soldiers moving from nearby bases toward different areas of the port city. Vacations have been canceled for police officers in Karachi, where the militant threat is growing but a military operation is not practical because of the risk of civilian casualties.

Security was also noticeably tighter in Islamabad, where paramilitary forces patrolled the streets.

In Peshawar, a northwestern city of more than 1 million people, police announced that they will break up even groups of five or more people to try to deter an attack, officials said.