"Pakistan is the main ally. If we were not with you, you would not manage anything. Let that be clear," he said in an interview with BBC radio.
"And if the ISI [Inter Services Intelligence] is not with you, you will fail. Let that be very clear also. Remember my words: if the ISI is not with you and Pakistan is not with you will lose in Afghanistan."
Musharraf recorded the interview after talks with Tony Blair, the British prime minister, in London on Thursday.
The meeting followed a leaked British defence ministry think-tank report that claimed that the ISI was indirectly supporting extremism in Afghanistan, Iraq and Britain by backing the MNA coalition of Pakistani religious parties.
Musharraf denied the claims, which were written by a senior military official linked to Britain's foreign intelligence service, MI6, after a fact-finding mission in June.
Musharraf pointed to ISI and Pakistan Army successes in the US-led "war on terror", in particular the capture of hundreds of suspected al-Qaeda members.
These included Khalid Shaikh Muhammad, the mastermind of the September 11 attacks, he said.
Musharraf also said Pakistan had played an integral role in foiling an alleged terror plot to blow up US-bound passenger jets on August 10 this year.
"From 1979 to 1989 we fought the Soviet Union for you. We won the Cold War for you," he said, explaining that the Pakistan army and ISI played a part in training the tens of thousands of mujahidin fighters to resist the Soviets in Afghanistan.
Yet after the Soviet withdrawal, the West left Pakistan "high and dry", he said, leading to the creation of the radicalised Taliban and al-Qaeda from the remnants of the mujahidin resistance.
"The world must understand our problem. It is for you that we did it and we are suffering," Musharraf told the broadcaster.
"Our national fabric has been torn.
"Now, without understanding, everyone blames us for what is happening in Pakistan. It is something that is happening, understand it and help us."