The Trump administration on Friday announced it will more closely scrutinize countries that are part of the Visa Waiver Program, which allows foreigners to travel to the U.S. without first securing a visa.

The U.S. has agreements with 38 countries — all close allies, and mostly from Europe — whose citizens are vetted by U.S. officials and then allowed to travel to America for up to 90 days without a visa.

The Department of Homeland Security said Friday it will now require those countries to keep closer track of travelers within their own borders to improve their internal monitoring of terrorists, and to reduce the number of their citizens who travel to the U.S. and overstay their visas.

Failure to comply with any of those provisions could prompt the U.S. to remove a country from the Visa Waiver Program, or to implement a variety of sanctions that would limit the ability of their citizens to travel to the U.S. Homeland Security officials, however, said they would prefer to work with the countries to fix the problems and maintain their status in the program.

"It's critically important we stay ahead of these threats by improving our security posture," Homeland Security Secretary Kirstjen Nielsen said in a statement. "These enhancements will strengthen the program, and they are part of our continued efforts to raise the baseline for homeland security across the board."

More:House panel hears debate about tightening tourist visa rules

More:U.S. now can ask travelers for Facebook, Twitter handles

More:More than 600K foreigners overstayed visas in 2016

The move represents the latest step by the Trump administration to more closely screen incoming travelers in the name of national security.

President Trump has tried several times to implement a travel ban against majority-Muslim countries that he has deemed to be threats because of their ties to terrorism. After recent terrorist attacks in the U.S., Trump has also called for an end to the diversity visa lottery and the long-standing practice of "chain migration" — the ability of U.S. citizens to sponsor their extended family for visas.

Homeland Security did not provide any examples of a foreigner entering the country through the Visa Waiver Program before committing an act of terrorism. But with 20 million people entering the country each year through the program, the department insists it must improve vetting procedures to ensure that the program is not exploited by terrorists.

Starting Friday, the department will begin scrutinizing Visa Waiver Program countries on three new grounds:

The countries must screen all travelers entering their country against databases provided by the U.S. of known terrorists and others who may pose a national security threat.

The U.S. will assess the safeguards used by each country against "insider threats" at their airports.

The U.S. will require that no more than 2% of travelers from each country end up staying in the U.S. past the expiration date of their visa.

The last requirement, which targets "visa overstays," highlights an ongoing problem in the U.S. immigration system. People who overstay their visas make up an estimated 40% of the 11 million undocumented immigrants who live in America.

In 2016, more than 600,000 foreign travelers who legally entered the United States overstayed their visas and remained in the country at the end of the year, according to Homeland Security data.

The Visa Waiver Program countries in violation of the new overstay measurement are Greece, Hungary, Portugal and San Marino. They could be required to pay for public education campaigns to inform their citizens of the overstay problem.

Homeland Security officials said it will not make public other countries considered to be in violation of the new requirements, but will negotiate with them directly to resolve the disagreements.

Other possible punishments include reducing from two years the amount of time travelers are allowed to freely travel to the U.S., intensifying vetting procedures used against applicants, and temporarily suspending a country from the program.

The U.S. Travel Association, which represents airlines, hotels and destination resorts, called the new measures a "sensible approach" to ensuring security.

"Every program should be constantly assessed and tweaked to ensure it performs as designed to stop threats," said Roger Dow, the association's CEO.