WASHINGTON — The U.S. government is temporarily barring passengers on nonstop U.S.-bound flights from eight Middle Eastern and North African countries from bringing laptops, iPads, cameras and some other electronics in carry-on luggage starting Tuesday.

The ban was revealed Monday in statements from Royal Jordanian Airlines and the official news agency of Saudi Arabia.

A U.S. official said the ban will apply to flights from 10 airports. The official did not name the airports or the countries. The official was not authorized to disclose the details of the ban ahead of a public announcement and spoke on the condition of anonymity.

The reason for the ban was not immediately clear. David Lapan, a spokesman for Homeland Security Department, declined to comment. The Transportation Security Administration, part of Homeland Security, also declined to comment.

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. It was unclear to what other countries and airlines the ban would apply.

The ban would begin just before Wednesday’s meeting of the U.S.-led coalition against the Islamic State group in Washington.