WASHINGTON — In a rare, bipartisan defeat for President Barack Obama, the Senate voted overwhelmingly Wednesday to block the transfer of Guantanamo Bay detainees to the United States and denied the administration the millions it sought to close the prison.

Democrats lined up with Republicans in the 90-6 vote that came on the heels of a similar move a week ago in the House.

The president readied a speech for today on the U.S. fight against terrorism.

Obama has vowed to close the prison by January, and the Senate's vote was not the final word on the matter.

It will be next month at the earliest before Congress completes work on the legislation, giving the White House time pursue a compromise that would allow the president to fulfill his pledge.

Obama's maneuvering room was further constrained during the day when FBI Director Robert Mueller told a congressional panel that he had concerns about bringing Guantanamo Bay detainees to prisons in the United States.

Among the risks is "the potential for individuals undertaking attacks in the United States," Mueller said.

After the Senate vote, White House press secretary Robert Gibbs said, "The president understands that his most important job is to keep the American people safe and that he is not going to make any decision or any judgment that imperils the safety of the American people."

He added that Obama has not yet decided where some of the detainees will be sent.

The administration had asked for $80 million to close the facility.

In spite of lawmakers' concerns, the Obama administration plans to send a top al-Qaida suspect held at Guantanamo y to New York to stand trial for the deadly 1998 bombings of U.S. embassies in Africa, an administration official said Wednesday. The suspect, Ahmed Ghailani, would be the first Guantanamo detainee brought to the United States and the first to face trial in a civilian criminal court.

The official, speaking on condition of anonymity because the person was not authorized to disclose the decision, said the administration plans to announce today that Ghailani will be brought to trial for the embassy attacks. Justice Department spokesman Dean Boyd declined to comment.