The ban, which affects flights from 10 airports, requires most personal electronics to be checked.

WASHINGTON — The U.S. government is temporarily barring passengers on certain flights originating in eight other countries from bringing laptops, iPads, cameras and most other electronics in carry-on luggage starting Tuesday.

The reason for the ban was not immediately clear. U.S. security officials would not comment. The ban was revealed Monday in statements from Royal Jordanian Airlines and the official news agency of Saudi Arabia.

A U.S. official told The Associated Press the ban will apply to nonstop flights to the U.S. from 10 international airports serving the cities of Cairo in Egypt; Amman in Jordan; Kuwait City in Kuwait; Casablanca in Morocco; Doha in Qatar; Riyadh and Jeddah in Saudi Arabia; Istanbul in Turkey; and Abu Dhabi and Dubai in the United Arab Emirates. The ban was indefinite, said the official.

A second U.S. official said the ban will affect nine airlines, and the Transportation Security Administration will inform the affected airlines at 3 a.m. Tuesday.

The officials were not authorized to disclose the details of the ban ahead of a public announcement and spoke on the condition of anonymity.

Royal Jordanian said cellphones and medical devices were excluded from the ban. Everything else, the airline said, would need to be packed in checked luggage. Royal Jordanian said the electronics ban affects its flights to New York, Chicago, Detroit and Montreal.

David Lapan, a spokesman for Homeland Security Department, declined to comment. The Transportation Security Administration, part of Homeland Security, also declined to comment.

A U.S. government official said such a ban has been considered for several weeks.

Homeland Security Secretary John Kelly phoned lawmakers over the weekend to brief them on aviation security issues that have prompted the impending electronics ban, according a congressional aide briefed on the discussion.