The 280 airports that send direct flights to the U.S. must have explosives-detecting scanners within 21 days, one step the Department of Homeland Security has mandated to avoid a broader ban on laptops aboard flights.

U.S. officials are giving 180 affected domestic and international airlines four months to make other security enhancements including more intensive passenger screening and monitoring of planes on the ground, according to a memo the International Air Transport Association sent to its member carriers after the DHS announced new security measures on Wednesday.

IATA also said foreign airports that fail to install explosive-trace detection scanners along with procedures to use them to scan carry-on bags at random could face a ban on carrying laptops into the cabin or a suspension of flights to the U.S.

An IATA spokesman declined to comment. The trade body’s leader, Alexandre de Juniac, said last week that the “aggressive implementation timeline will…be challenging.”

Homeland Security Secretary John Kelly has warned for months that terrorists are aiming to take down a plane with explosives hidden in a laptop. In March, he banned personal electronic devices in the cabins of planes flying to the U.S. from 10 airports in the Middle East and North Africa. That prohibition could be lifted if those airports and airlines meet the new edits.

The official confirmed that DHS intends to work with airlines that may not be able to install the machines promptly. Interim steps could shore up security while airlines works toward compliance, the official said. Carriers that don’t comply or agree to a plan to do so could face fines, a ban on laptops in the cabin and the cargo hold, or a ban on flying to the U.S., the official added.

The DHS official said many of the affected airports already have the scanners, which measure for traces of explosives by analyzing a swab taken from a flier’s luggage or hand. Such machines also are used to check for narcotics. Manufacturers say the test takes about 30 seconds and that the machines cost between $25,000 and $50,000.

Click for more from The Wall Street Journal.