WASHINGTON — Passengers flying to the United States from foreign airports will undergo more rigorous screening of their baggage and electronic devices, but they will be allowed to bring laptops and tablets onto planes in their carry-on bags, the Department of Homeland Security announced on Wednesday.

After months of discussions with aviation officials in Europe about banning large electronic devices, homeland security officials ultimately abandoned the idea in favor of more robust screening measures. In March, the department imposed a limited ban barring passengers traveling through airports in 10 Muslim-majority countries from carrying devices larger than cellphones aboard direct inbound flights.

Now, agency officials said, the ban on those airlines will be lifted if they carry out the new security measures.

The officials, during a background briefing with reporters, did not elaborate on what the new intensive measures would include other than more bomb-sniffing dogs and new scanning equipment.