Congress on Tuesday gave two more weeks of life to a law that allows the government more freedom to eavesdrop on suspected terrorists inside the United States, buying the Senate time to pass a bill to replace it.

Lawmakers had hastily adopted the law last August when the White House warned of dangerous gaps in its surveillance authority. Civil rights and privacy advocates say the broadly written law, which was to expire Friday, allows the government to eavesdrop on innocent Americans without oversight from a court created for that purpose.

Senators approved the extension by voice vote Tuesday night, giving them more time to break an impasse over how to update the Foreign Intelligence Surveillance Act. That 1978 law dictates when the government needs court approval to conduct electronic surveillance inside the United States. Earlier in the day, the House voted in favor of the 15-day extension.

While the idea of a two-week extension at first gained little if any support from the White House, the administration deemed it acceptable by day's end.

"While we maintain that Congress has had sufficient time to conclude its work, we have indicated to congressional leaders that we will accommodate this request so that Congress can live up to its commitment to passing a bill that gives the intelligence community the tools they need to protect the nation," White House deputy press secretary Tony Fratto said Tuesday night. "Congress should complete its work before departing for its next break."

Senate Republican leaders on Tuesday reversed their opposition to extending the existing law, saying they would agree to an extension if the Senate could swiftly pass a new surveillance bill. That legislation, favored by the White House, includes giving retroactive legal immunity to telecommunications companies that allowed the government to wiretap their customers without court permission.

Some 40 civil lawsuits have been filed against telecommunications companies. They carry with them a threat of crippling financial penalties, which the White House says could bankrupt the companies. The House had passed in October a version of the bill that did not provide retroactive legal immunity.

President Bush planned to push for a new law in a speech Thursday in Las Vegas. The White House had threatened to veto a proposed 30-day extension, hoping the law's expiration Friday would pressure Congress into passing a surveillance bill that includes telecom immunity.