The House voted Thursday night to strengthen court oversight of the government’s surveillance of terrorist suspects but stopped short of providing legal immunity to telecommunication companies that helped eavesdrop on Americans.

The Democratic bill, approved 227-189, was a rebuke to President Bush, who has promised to veto any legislation that does not shield telecom companies from civil lawsuits. About 40 civil suits have been filed alleging the companies broke wiretapping and privacy lawsuits for monitoring phone calls and e-mails without permission of a secret court created 30 years ago for that purpose.