It is interesting to note that Al Qaeda and Saddam Hussein both received military aid from the Reagan administration in the 80's.
Saddam received military hardware to fight against Iran - including permission to buy components in the US that could be used to build biological weapons - even as the US knew of his massacres of the Iraqi kurds. Many members of Al Qaeda - including Bin Laden himself - received money from Pakistan to fight the Soviet Union - money given to Pakistan by the United States precisely to supply anti-Soviet fighters.
What the Reagan administration was guilty of was remarkable shortsightedness. No doubt it served the short-term purpose of the United States to fund opponents of the Soviet Union and of Iran. And though funding Iraq was clearly irresponsible, it was by no means easy to predict the actions of Bin Laden and other radical muslim anti-Soviet fighters.
Unfortunately, we don't seem to be learning from past mistakes. A year or so ago, the United States announced the sale of F-16s to Pakistan - see here for an overview.
It might be in the short term interest of the United States to sell these to Pakistan, as its cooperation is needed for operations in Afghanistan. Long term, however, we are selling weapons to a country that is within a hair's breadth of being controlled by Islamic extremists. We may get lucky, but clearly this is a move that does not make sense.