Flying to the U.S. and U.K. from airports in the Middle East and North Africa got a lot more complicated this week.

The Trump administration ordered nine airlines to stop passengers from bringing most types of electronic devices -- not including smartphones -- into the cabin for U.S.-bound flights. Instead, those devices must now be carried in the hold.

The U.K. government has announced similar restrictions.

The sudden moves, attributed to concerns about potential terrorist attacks, create a new headache for airline staff and passengers.

Which airports are involved?

The U.S. ban covers flights from 10 airports, including major global hubs such as Dubai.

Here's the full list of countries: Cairo, Egypt; Dubai and Abu Dhabi, United Arab Emirates; Istanbul, Turkey; Doha, Qatar; Amman, Jordan; Kuwait City; Casablanca, Morocco; and Jeddah and Riyadh, Saudi Arabia.

The U.K. ban covers all inbound flights from Turkey, Jordan, Lebanon, Egypt, Tunisia and Saudi Arabia but omits major airports such as Dubai, Abu Dhabi and Doha.

Related: The world's busiest passenger airports

Which airlines are affected?

The airlines that fly direct to the United States from the affected airports are EgyptAir, Emirates Airline, Etihad Airways, Kuwait Airways, Qatar Airways, Royal Air Maroc, Royal Jordanian Airlines, Saudi Arabian Airlines and Turkish Airlines.

No U.S. airline flies from the airports in question to the United States.

The U.K. restrictions apply to 14 airlines: British Airways, EasyJet, Jet2.com, Monarch, Thomas Cook, Thomson, Turkish Airlines, Pegasus Airways, Atlas-Global Airlines, Middle East Airlines, Egyptair, Royal Jordanian, Tunis Air and Saudia.

Which devices are banned?

Smartphones will still be allowed in the cabin. But any electronic devices bigger than that will have to be checked in, either with your luggage or at the gate. That includes laptops, cameras, gaming devices and tablets such as iPads.

Medical devices (and cameras on U.K.-bound flights) will still be allowed in the cabin after security screening.

Related: Trump travel ban is discouraging U.S. visitors

When will it take effect?

The U.S. government officially notified the airlines at 3 a.m. ET Tuesday. Some airlines flying to the U.S. have already started enforcing the new rules. The rest have until Saturday to comply.

And if they don't? "We will work with the FAA to pull their certificate and they will not be allowed to fly to the United States," one senior U.S. official said.

Some U.K. airlines have also already introduced new restrictions.

What happens at the airport?

Airlines have been scrambling to implement the new rules. If you're flying from the region to the U.S. or U.K., the best advice is to arrive earlier than normal.

Expect to be asked to check in tablets, laptops and other banned devices with your luggage. You will still need to hand in your devices even if your final destination is not the United States or Britain -- for example, if you're flying from Amman, Jordan, to Montreal through Detroit.

But some airlines, such as Emirates and Turkish Airlines, will allow you to keep your gadgets until just before boarding. You'll have to hand them to staff at the departure gate for packing and stowing in the hold.

Related: Laptop ban may force business travelers to skip Mideast hubs

What's the reason for the ban?

U.S. officials say the move is a response to fears that terrorist groups may target passenger planes by smuggling explosive devices in electronic devices. One official said there's no specific plot authorities are aware of, but the U.S. has been considering such a ban for some time.

Intelligence obtained in recent weeks found that al Qaeda in the Arabian Peninsula was perfecting techniques for hiding explosives in batteries and battery compartments, according to a U.S. official. Intelligence also shows growing capability and threat from al Qaeda in Syria, ISIS and Al Shabaab.

"There is a growing pool of intelligence all pointing to threats to aviation," an official said.

Related: Gulf airlines worry electronics ban will hurt them

How can I protect my devices?

Electronic devices that are checked in can be damaged, lost, even hacked. Before you check anything in, consider the risks and take steps to protect your devices and data.

Many airlines specifically say they will not be held liable if these items break or are lost. They warn against packing valuable or breakable items like computers in checked baggage.

The best way to keep your data from falling into the wrong hands is not to check a computer at all.

If you have to bring a device, set up a passcode or fingerprint lock. Do a full backup before leaving for the airport. Experts recommend shutting the computer down completely, not just putting it into a sleep mode.

A more secure option is to wipe a laptop or tablet clean before traveling. That can be difficult so you may want to consider switching to a "burner" laptop — an inexpensive device that doesn't have sensitive information on it.

Related: How to keep your laptop safe under the new airline ban

Why some airports and not others?

The U.S. is especially concerned about the 10 airports in question, the official said, because of screening issues and the possibility of terrorists infiltrating the ranks of authorized airport personnel.

It's not clear why the U.K. used a different list. Emirates President Tim Clark has questioned why the U.S. restrictions apply to Dubai, where -- he says -- security is as good if not better than airports in Europe and America.

Flight and cabin crews are not covered by the new restrictions.

Related: Emirates president: 'Amazing' to suggest Dubai airport is not safe

Isn't it dangerous to put electronic devices in checked baggage?

Safety experts and regulators have long warned that batteries shipped in bulk could start a fire and even bring down a plane. The International Civil Aviation Organization advised global regulators last year to ban carrying bulk shipments of such batteries in the cargo holds of passenger jets.

Related: Lithium-ion batteries banned as cargo on passenger planes

But electronics spread out across a person's luggage pose far less of a threat than palettes of lithium batteries, according to a U.S. aviation official.

-- Jon Ostrower, Heather Kelly, Rene Marsh, Isil Sariyuce, John Defterios and Felicia Wong contributed to this report.