Facing an attempt in the legislature to pass a referendum on recalling the president , the government here unexpectedly announced on Wednesday that it had reached a deal with Beijing to allow many charter flights to and from mainland China .