UN Security Council passed Resolution 1510 regarding international involvement in Afghanistan and created the ISAF to implement the Resolution.
I don’t think the US just threw the problem to the UN and took off; it appears that the UNSC sought involvement in Afghanistan and used NATO forces as the muscle for the Resolution.