WASHINGTON  Advocacy groups and some legal experts told Congress on Wednesday that it was unreasonable for federal officials to search the laptops of United States citizens when they re-enter the country from traveling abroad.

Civil rights groups have said certain ethnic groups have been selectively profiled in the searches by Border Patrol agents and customs officials who have the authority to inspect all luggage and cargo brought into the country without obtaining warrants or having probable cause.

Companies whose employees travel overseas have also criticized the inspections, saying that the search of electronic devices could hurt their businesses.

The federal government says the searches are necessary for national security and for legal action against people who bring illegal material into the country.