ISLAMABAD — Pakistan’s presumptive prime minister called for peace talks with Taliban militants at war with the government Monday, potentially charting a course that could put him at odds with the country’s powerful army.

Nawaz Sharif said “terrorism” was one of the most serious problems plaguing the country and any offer by the Pakistani Taliban to talk “should be taken seriously.”

“All options should be tried, and guns are not a solution to all problems,” Sharif said in a speech to newly elected members of his party in the eastern city of Lahore. “Why shouldn’t we sit and talk, engage in dialogue?”

The Pakistani Taliban have been waging a bloody insurgency against the government for years that has killed thousands of people. The militants say they are fighting to enforce Islamic law in the country and end the government’s alliance with the United States.

The Pakistani army has launched multiple operations against the Taliban in their strongholds along the border with Afghanistan, but the militants have proven resilient and continue to carry out near-daily attacks.

Army chief Gen. Ashfaq Parvez Kayani, who met with Sharif on Saturday for the first time since the May 11 election, laid out strict conditions last month for any potential peace deal with the Taliban.

“We sincerely desire that all those who have strayed and have picked up arms against the nation return to the national fold,” Kayani said in a rare public speech. “However, this is only possible once they unconditionally submit to the state, its constitution and the rule of law.”

It’s unclear whether Sharif’s concept of peace fits within this framework. Activists have raised concerns that Sharif’s government could accept militant demands that would threaten human rights in the country, especially for women.

The Pakistani government has previously struck peace deals with the Taliban, but they haven’t held and have been criticized for allowing the militants to regroup.

Sharif has called for peace talks in the past, but Monday’s speech was the first time he has done so publicly since his Pakistan Muslim League-N party scored a resounding victory in the election.

The Taliban have shown an inclination to negotiate with Sharif, who is known to be a devout Muslim and whose party has been criticized for not cracking down on Islamic militants in its stronghold of Punjab province.

Taliban spokesman Ahsanullah Ahsan told The Associated Press last week that the group would consider declaring a cease-fire if Sharif seemed serious about holding peace talks.

The Taliban carried out a spate of attacks against candidates and workers from secular parties in the run-up to the election. The violence raised concerns that the group was trying to influence the outcome of the election by making campaigning easier for candidates like Sharif who are perceived to take a softer line toward the militants.

Also Monday, a judge granted bail to Pakistan’s former military ruler in a case related to the assassination of ex-Prime Minister Benazir Bhutto, one of his lawyers, Salman Safdar, said.

Despite the bail, retired Gen. Pervez Musharraf will remain under house arrest on the outskirts of the capital, Islamabad, in connection with two other cases against him, including one related to his decision to sack senior judges while in power.

The roughly $20,000 bail comes days after the lawyer who filed the judges case against Musharraf, Mohammad Aslam Ghumman, said he had decided not to testify against the former military strongman for the sake of “national interest.”

Ghumman’s decision has fueled speculation that Musharraf may be allowed to leave the country before the new government led by Sharif takes power in early June. The bail in the Bhutto case could intensify that speculation.

Musharraf seized power by toppling Sharif in a military coup in 1999 and ruled for almost decade until he was forced to step down in 2008 because of growing discontent with his rule. He spent years in self-imposed exile and returned in March to compete in the recent election.

But he was disqualified from the election because of his actions while in power, and has faced a raft of legal challenges against him since he arrived. He was placed under house arrest in April, and his name has been placed on the exit control list, preventing him from leaving the country.

Government prosecutors have accused Musharraf of being involved in the gun and suicide attack that killed Bhutto in 2007 when he was in power. They have also blamed him for not providing the former premier with enough security.

Musharraf has denied the allegations and claimed they were politically motivated. He has blamed the Pakistani Taliban for the attack.

Suspected militants killed a policeman who was guarding a polio vaccination team in Pakistan’s northwest Bajur tribal area on Monday, said local government administrator Faramosh Khan. It was the latest in a spate of attacks on polio workers in the last six months.

Militants have accused the polio workers of being U.S. spies and claimed the vaccine is intended to make Muslim children sterile.