Republicans succeeded this week in pushing through a key piece of President Bush's anti-terror agenda, passing along party lines legislation that would endorse the military program to detain and interrogate terrorists.

The administration's allies fell short, however, in their efforts to authorize the terrorism surveillance program championed by Bush. That bill would have to be finished after lawmakers return for a lame-duck session following the November elections.

Both chambers this week approved legislation that sets up "military commissions" to prosecute terrorists. It also would prohibit the severe abuse of detainees, like mutilation and rape, but grant the president leeway to decide which other interrogation techniques are permissible.

Get complete coverage in FOXNews.com's War on Terror Center.

The Senate's 65-34 vote on Thursday followed a House vote of 253-168 on a nearly identical measure a day earlier. To avoid having to reconcile differences between the two bills, which were described as minor, the House planned to vote Friday on the Senate bill and send that version to the president to sign.

"The Senate sent a strong signal to the terrorists that we will continue using every element of national power to pursue our enemies and to prevent attacks on America," Bush said in a statement Thursday night.

The White House failed to help bridge differences between the Senate and the House on the eavesdropping program. The House, on a 232-191 vote Thursday, approved a bill to grant legal status to the warrantless wiretapping program with new restrictions. The Senate bill was different enough that efforts to reach a compromise on the two measures was unlikely before the elections.

Most Democrats opposed the detainee bill, contending that Republicans were pushing through a sloppy measure to sell voters, but not because it made sense. GOP policies on national security "may have been tough, but they certainly weren't smart," said Senate Minority Leader Harry Reid.

"I'm convinced that future generations will view passage of this bill as a grave error," added Reid, D-Nev.

Added Sen. Dianne Feinstein, D-Calif., "We are being asked to consider legislation that will determine how our troops and personnel, foreign troops and personnel, as well as innocent bystanders will be treated when captured during conflict."

But Republicans said passage of the bill would withstand court scrutiny and the test of time.

"In this new era of threats, where the stark and sober reality is that America must confront international terrorists committed to the destruction of our way of life, this bill is absolutely necessary," said Sen. Saxby Chambliss, R-Ga.

The overall bill would prohibit war crimes and define such atrocities as rape and torture but otherwise would allow the president to interpret the Geneva Conventions, the treaty that sets standards for the treatment of war prisoners.

Under the bill, a terrorist held at Guantanamo Bay, Cuba, could be tried by a military commission so long as he was afforded certain rights, such as the ability to confront evidence given to the jury and having access to defense counsel.

Those subject to commission trials would be any person "who has engaged in hostilities or who has purposefully and materially supported hostilities against the United States or its co-belligerents." Proponents say this definition would not apply to U.S. citizens.

The bill would eliminate some rights common in military and civilian courts. For example, the commission would be allowed to consider hearsay evidence so long as a judge determined it was reliable. Hearsay is barred from civilian courts.

The legislation also says the president can "interpret the meaning and application" of international standards for prisoner treatment, a provision intended to allow him to authorize aggressive interrogation methods that might otherwise be seen as illegal by international courts.

Visit FOXNews.com's War on Terror Center for complete coverage.