Ban to take effect within months after pressure from Tory rebels and Washington