The invasion to fight militants quickly ousted the hardline Taliban government .