WASHINGTON - President Bush has signed an executive order requiring contractors and others who do business with the federal government to make sure their employees can legally work in the United States.

Bush signed the order Friday, and the White House announced it yesterday.

The federal government has had some embarrassing moments when contractors it has hired turned out to have illegal workers, Homeland Security Secretary Michael Chertoff said. The government is trying to get its own house in order, he said.

"The federal government should lead by example and not merely by exhortation," he said at a news conference.

The order says federal departments and agencies must require that contractors use an electronic system to verify that the workers are eligible to work in the United States.

Homeland Security operates E-Verify, a Web-based system that Chertoff said 1,000 employers a week were signing up to use. The system allows employers to check the Social Security numbers that employees provide.

The order affects hundreds of thousands of workers, at the least, and potentially millions, Chertoff said.

It aims to crack down on hiring of illegal immigrants. But people who overstayed visas or came to the country legally but lack permission to work, such as some students or those awaiting work permits, also could be snagged with the system.

"It is the policy of the executive branch to enforce fully the immigration laws of the United States, including the detection and removal of illegal aliens and the imposition of legal sanctions against employers that hire illegal aliens," the order says.

It comes as a worker-verification bill has essentially stalled in Congress.

Rep. Brian Bilbray (R., Calif.), who heads the Immigration Reform Caucus, a group of lawmakers who support tougher immigration laws, called Bush's order "a great decision."

"I think it's what the American people have been asking for," he said, "commonsense, basic things that are not draconian or dramatic."

The use of E-Verify has run into opposition over the years from business groups who say the system is burdensome, and civil libertarians who say it will lead to discrimination and job losses by U.S. citizens misidentified as illegal workers.

Concerns about the system's effect on privacy is to be the topic of a House Judiciary subcommittee hearing today. Several members of Congress are to testify.