The FBI and other federal crimefighting agencies came out well in a $57.9 billion spending bill passed by the Senate on Wednesday, but funds for state and local law enforcement were cut.

The 94-5 Senate vote sent the bill, which covers Justice, Commerce, State Department and science agency programs, to President Bush for his signature.

House and Senate negotiators also were wrapping up work on a $140 billion spending bill for Transportation, Treasury and Housing programs after the Senate agreed to remove a provision — under the threat of a presidential veto — that would have eased restrictions on agriculture trade to Cuba.

"They just caved in to the president's demands and the American farmers will pay the price," said Sen. Byron Dorgan, D-N.D., who has opposed the administration policy of tightening trade sanctions on Fidel Castro's government.

The Justice-Commerce bill for fiscal year 2006 that began Oct. 1 would provide $5.8 billion for the FBI, $1.7 billion for the Drug Enforcement Administration and $924 million for the Bureau of Alcohol, Tobacco, Firearms and Explosives, all up from fiscal 2005.

But the $2.7 billion in aid for state and local law enforcement, while $1.1 billion above the president's request, was down $300 million from last year.

Edward Byrne Justice Assistance grants were down from $606 million to $416 million. Community Oriented Policing Services (COPS), a favorite Clinton administration program, got $478 million, down from $598 million, with no money for new hiring.

"Byrne grants and COPS are the two most important sources of federal funds to boost police and sheriff forces throughout our country," said Sen. Mark Dayton, D-Minn. And Sen. Barack Obama, D-Ill., said the loss of Byrne grants for Illinois will make it more difficult to combat the methamphetamine epidemic, "one of the gravest threats facing the nation today."

"This is a big victory for drug dealers," said Sen. Max Baucus, D-Mont.

The legislation also includes $16.5 billion for NASA, up $260 million. The president's space exploration program would be funded at $3.1 billion and $270 million would be provided for a repair mission to the Hubble telescope.

The Legal Services Corporation would get $331 million, the same as last year, and the National Oceanic Atmospheric Administration receives would $3.9 billion, up $21 million.

The Transportation-Treasury bill, which calls for about $1.3 billion for financially troubled Amtrak, was held up last week over provisions in both the House and Senate bills that would rescind Treasury Department rules making it more difficult to export food products to Cuba.

House negotiators, seeking to avoid what would be the first veto of the Bush presidency, resolved to eliminate the provision, but the Senate initially insisted that it be kept in the bill. Dorgan said the Senate has now decided to acquiesce so the bill could go forward. He chided his fellow senators, saying, "They didn't have the stomach to take the White House on."

The Justice-Commerce bill is the seventh spending bill Congress has sent to the president as it rushes to finishes its work on domestic budgets by Thanksgiving. Congress must act on 11 spending bills that determine funding for about one-third of the federal budget.

Stopgap funding expires Friday, and the House is expected to pass a second temporary funding bill Thursday to keep open agencies whose budgets have not passed. That measure would extend through Dec. 17, though lawmakers hope the remaining spending bills will be done long before then.

Republican leaders were to meet Wednesday to determine the fate of the Pentagon spending bill. In the past, Congress has taken pains to pass that measure by the Oct. 1 start of the fiscal year. But it has been held back this year as lawmakers wrangle over a provision by Sen. John McCain, R-Ariz., to tighten laws against torturing prisoners of war.

The defense bill also has been eyed as a vehicle to carry other legislation into law next month such as an across-the-board cut to agency budgets, emergency funding for victims of Hurricane Katrina and money to prepare for a potential bird flu pandemic.