WASHINGTON, Oct. 18  The Senate Intelligence Committee voted Thursday night to approve compromise legislation that would strengthen court oversight of eavesdropping on Americans while granting telephone and Internet companies legal immunity for their role in assisting government surveillance programs since 2001.

After nearly five hours of closed discussions, Senator John D. Rockefeller IV of West Virginia, the Democratic chairman, and Senator Christopher S. Bond of Missouri, the Republican vice chairman, emerged to announce that the measure had been approved in a 13-to-2 vote.

“There were substantial compromises on the part of all members and, frankly, of the administration,” Mr. Rockefeller said of the measure, which would expire in six years. Two Democratic senators, Russ Feingold of Wisconsin and Ron Wyden of Oregon, cast the no votes.

But passage in the committee came with one unexpected hitch. In an interview after the closed session, Mr. Wyden said he had succeeded, by a vote of 9 to 6, in adding an amendment that would offer additional protections by requiring that the government get a warrant whenever it wanted to wiretap an American outside the country, like an American soldier based overseas or a business person.