Pakistan's Prime Minister Imran Khan on Monday said his country committed "one of the biggest blunders" by joining the US after the 9/11 attacks. The previous governments "should not have pledged what they could not deliver", Mr Khan said, referring to General Pervez Musharraf's decision to side with the US.
Pakistan was one of the three countries that recognised the Taliban government in Afghanistan before the US invasion in 2001. After the US invasion following the 9/11 attack, Pakistan supported the American forces against the Taliban.
"In the 1980s, when the Soviets invaded Afghanistan, Pakistan, helped by the US, organised the resistance to the Soviets. The ISI (Inter-Services Intelligence) trained militants who were invited from all over the Muslim world for jihad against the Soviets," Mr Khan said in response to a question at the Council on Foreign Relations (CFR) think tank in New York City.
"And so we created these militant groups to fight the Soviets... Jihadis were heroes then. Come 1989, Soviets leave Afghanistan, the US packs up and leaves Afghanistan... And we were left with these groups," he added.
"Then comes 9/11, and Pakistan again joins the US in the war on terror and now we are required to go after these groups as terrorists. They were indoctrinated that fighting foreign occupation is jihad but now when the US arrived in Afghanistan, it was supposed to be terrorism," Mr Khan said.
"So Pakistan took a real battering in this," he said, adding that Pakistan should have stayed neutral in the conflict.
He said there could be no military solution in Afghanistan, adding he will ask US President Donald Trump to resume peace talks.
"For 19 years if you have not been able to succeed, you are not going to be able to succeed in another 19 years," he added.
On Pakistan's fragile economy, Mr Khan said his government had inherited "the biggest current account deficit" in the country's history and "so the first year has been a real struggle."
Mr Khan thanked China for helping "when we were at the rock bottom".