WASHINGTON  The Senate voted 51 to 45 on Wednesday afternoon to ban waterboarding and other harsh interrogation methods used by the Central Intelligence Agency against high-level terrorism suspects.

Senate Republicans generally opposed the bill, but several of them also did not want to cast a vote that could be construed as supporting torture, and so were relying on President Bush to make good on a threat to veto legislation limiting C.I.A. interrogation techniques.

The prohibition of harsh interrogation techniques is part of a wider intelligence authorization bill and would restrict all American interrogators to techniques allowed in the Army Field Manual, which bars the use of physical force.

The House approved the bill in December by a vote of 222 to 199, mostly along party lines. Wednesday’s vote in the Senate was also along party lines. All the “no” votes were cast by Republicans, except for those of Senators Joseph I. Lieberman, an independent from Connecticut, and Ben Nelson, Democrat of Nebraska. Five Republicans and Senator Bernard Sanders, independent of Vermont, voted “yes.”