The most powerful and popular man in Pakistan, Gen. Raheel Sharif, announced Monday that he will step down as army chief when his term expires in November, a positive step for the country’s historically unstable democracy but one that creates new uncertainty about the battle against Islamist militants.

Sharif, who pushed the country onto a war footing against the Pakistani Taliban and is credited for a steep decline in terrorist attacks, made his announcement on Twitter. “I don’t believe in extensions and will retire on due date,” Sharif said through his chief spokesman, Lt. Gen. Asim Bajwa. He added that the fight against “terrorism will continue with full vigor and resolve.”

[Taliban rifts exposed by campus attack]

Sharif’s announcement could have major implications for Pakistan’s posture toward Islamist extremist groups as well as efforts to encourage peace talks between Afghanistan’s government and the Taliban insurgency. Sharif is widely considered to be a dominant voice in Pakistan’s efforts to nudge the Afghan Taliban into formal talks with Kabul.

Under Pakistan’s constitution, army chiefs hold the post for three years but are eligible for extensions. Sharif’s predecessor, Gen. Ashfaq Kayani, served for six years. But Kayani’s extension was controversial in a country that has been under military rule for about half of its 68-year history.

“Thank you Raheel Sharif,” one of Pakistan’s most prominent and progressive columnists, Cyril Almeida, tweeted after Sharif announced his plans to retire.

Still, the departure of the popular army chief could usher in a new period of unease. Although Pakistan completed its first transfer of power from one democratically elected government to another in 2013, many Pakistanis still look to the army for stability and security.

After Prime Minister Nawaz Sharif passed over more-senior military leaders to promote Gen. Sharif in 2013 — the two are not related — the new army chief pressured the government into supporting a major military operation against the Pakistani Taliban.

[New Afghan Taliban leader faces test over peace talk bid]

Coupled with the evacuation of more than 1 million civilians from North Waziristan in Pakistan’s tribal belt, the army sent 250,000 soldiers into the area in June 2014, driving Islamist militants from most of their safe havens near the Afghan border, according to assessments from Western officials.

Sharif also coordinated an operation against Islamist militants and criminal gangs in unruly Karachi, Pakistan’s largest city.

“General Sharif rightly conceived that the war on terror needed to be fought from the front,” said Nazir Mohmand, a retired Pakistani army brigadier.

Over the past year, those operations are credited with a major decline in violence. Deaths from terrorist attacks dropped by nearly 50 percent, and 2015 was the safest year in Pakistan since 2006, according to data compiled by the South Asia Terrorism Portal.

With Pakistan’s economy also improving as security concerns have eased, Gen. Sharif’s popularity soared. He had an 83 percent approval rating in a poll issued in October by the Pakistan Institute of Legislative Development and Transparency. But there have been moments of tension and controversy during his tenure.

[Afghan leader stirs backlash over outreach to Pakistan]

In his first year as prime minister, Nawaz Sharif called for rapprochement with Pakistan’s archenemy, India. Many analysts suspect that call unsettled the Pakistani military, causing it to fan anti-government demonstrations in Islamabad in 2014.

Amid speculation that a coup was imminent, Gen. Sharif visited the prime minister. According to an account of that meeting by the Reuters news agency, he told the prime minister there would be no coup so long as the military kept full control over Pakistan’s foreign policy. Since then, both Sharifs have worked to play down any tension between the military and the civilian government.

Gen. Sharif also appeared to have good relations with the Obama administration as well as U.S. military commanders in Afghanistan. Western officials have said they generally viewed him as a more honest and determined partner than some past Pakistani military rulers, including Kayani.

[Numbers say Pakistan safer, but attitudes more skeptical]

But his departure comes at a critical time. Last week, the Pakistani Taliban killed 20 students and two teachers when it attacked a college near Peshawar. The United States, China, Pakistan and Afghanistan are in talks about reviving the Afghan peace process. Some U.S. officials have become encouraged that the Pakistani army doesn’t intend to stand in the way of planned talks between Islamabad and New Delhi.

Mohmand said Gen. Sharif is mindful of how the public and international image of both Kayani and ex-military ruler Pervez Musharraf, who led the country for nine years in the late 1990s and early 2000s, seemed to deteriorate the longer they held power. “By deciding himself not to take extension, he is saying that the institutions are bigger than the individuals, and the state is bigger than the institutions,” Mohmand said.

Gen. Zubair Mahmood Hayat, Pakistan’s army chief of general staff, is most often mentioned as a likely successor.

Shaiq Hussain in Islamabad and Haq Nawaz Khan in Peshawar contributed to this report.

Read more:

Today's coverage from Post correspondents around the world