Both were manipulating each other. The only difference is that USA couldn't tolerate that Pakistan out-manipulated USA in the strategy game at the end.
USA tried to dump the mess on Pakistan in 1994 but failed miserably. Pakistan immediately sorted that mess by relegating to Indian Occupied Kashmir.
After war on terror, USA tried its every resource but failed miserably. Once again leaving the mess [Afghanistan] behind for Pakistan to take care of. Pakistan will take care of the mess as usual.
India is also making stupidest mistake by funding terrorism through Afghan-based terrorist-outfit aka TTP as per the official confession from Ajit Doval aka in-charge of Indian NSA. It is stupid to lock horns with the Nuclear military nation that trained the groups breaking USSR apart. It was not USA and India that did that. It was Pakistan intels that broke USSR apart. Then again, stupidity [India] knows no bound.