It can keep close ties to Islamist groups that America and many of its regional partners do not like at all.