The government said Thursday that it will no longer treat some foreign visitors harshly just because they stayed too long on previous trips.

Effective immediately, foreigners allowed to enter the United States on passports -- those from visa-waiver countries, many in Europe -- will not be handcuffed, searched or denied entry if it turns out they had stayed a few days longer than they should have on previous visits, a Department of Homeland Security official said.

In the past, these people "were treated as criminals," said Robert C. Bonner, Bureau of Customs and Border Protection commissioner. The visa-waiver program allows citizens from 27 nations that are U.S. allies to enter the country without visas.

Since the Sept. 11, 2001, attacks, foreigners who had stayed longer than allowed have been denied reentry and taken into custody if a return flight to their home country was not immediately available.

The new policy restores to inspectors some of the discretion curtailed after Sept. 11. Some of the hijackers had overstayed their visas but were allowed reentry into the United States, investigators have found.

Inspectors at major airports and other ports of entry will be allowed to decide whether the visitor is a security risk. If not, the officers can allow the visitor to enter the country for as long as 90 days.