The Taliban ruled most of Afghanistan from the mid-1990s until 2001 , imposing an extreme version of Islam and harboring Al Qaeda leaders and thousands of other Muslim militants from around the world .