LONDON — British Airways and Lufthansa abruptly canceled all flights to Cairo on Saturday for security reasons, a day after the British government warned of a heightened risk of terrorist attacks against planes over Egypt.

British Airways told stunned passengers at their departure gate in London that they could not fly and could not reschedule their flights for one week.

“We constantly review our security arrangements at all our airports around the world,” the airline said, “and have suspended flights to Cairo for seven days as a precaution to allow for further assessment.”

The airlines, two of Europe’s largest, did not give any further details on the security issue. Lufthansa said that it would resume its flights on Sunday.