The Senate voted 72-26 for the measure, which cleared the House a little more than 24 hours earlier on a similarly lopsided vote. Obama's signature on the bill was expected in time to prevent any interruption in government funding Saturday at midnight.

The huge bill funds every agency of government, pairing increases for NASA and Army Corps of Engineers construction projects with cuts to the Internal Revenue Service and foreign aid. It pays for implementation of Obama's health care law; a fight over implementing "Obamacare" sparked tea party Republicans to partially shut the government down for 16 days last October.

Also included is funding for tighter regulations on financial markets, but at levels lower than the president wanted.

The compromise-laden legislation reflects the realities of divided power in Washington and a desire by both Democrats and Republicans for an election-year respite after three years of budget wars that had Congress and the White House lurching from crisis to crisis. Both parties looked upon the measure as a way to ease automatic spending cuts that both the Pentagon and domestic agencies had to begin absorbing last year.

All 53 Democrats, two independents and 17 Republicans voted for the bill. The 26 votes against it were all cast by Republicans.

The measure advanced to Obama three months after House Republicans called off the government shutdown and sought a scaled-back bargain with Democratic lawmakers and the president. It added the details to the framework laid out by the December bargain between the chairmen of the House and Senate Budget committees.

Congress still has to act in the next few weeks to increase the government's borrowing cap to avoid a potentially devastating default on U.S. obligations, but GOP leaders no longer appear to have much enthusiasm for a showdown with Obama over that issue. House Speaker John Boehner, R-Ohio, told reporters Thursday that the government "shouldn't even get close" to a default.

Obama's budget director, Sylvia Mathews Burwell, called the spending bill's passage a positive step for the nation and the economy. "It ensures the continuation of critical services the American people depend on," she said in a blog post.

Shortly before the final vote, Sen. Ted Cruz, R-Texas, delivered a slashing attack on Senate Democrats, accusing them of ignoring the problems caused by the health care law. "It is abundantly clear that millions of Americans are being harmed right now by this failed law," Cruz said.

Unlike last fall, when he spoke for 21 straight hours and helped force the government shutdown over defunding Obamacare, this time he clocked in at 17 minutes and simply asked the Senate to unanimously approve an amendment to strip out Obamacare funding. Democrats easily repelled the maneuver.

The 1582-page bill was really 12 bills wrapped into one in negotiations headed by Rep. Harold Rogers, R-Ky., and Sen. Barbara Mikulski, D-Md., respective chairmen of the House and Senate Appropriations committees, and their subcommittee lieutenants. They spent weeks hashing out line-by-line details of a broad two-year budget accord passed in December, the first since 2009.

The bill, which cleared the House on a vote of 359-67, increases spending by about $26 billion over fiscal 2013, with most of the increase going to domestic programs. Almost $9 billion in unrequested money for overseas military and diplomatic operations helps ease shortfalls in the Pentagon and foreign aid budgets.

The nuts-and-bolts culture of the appropriators is evident throughout the bill. Lower costs to replace screening equipment, for example, allowed for a cut to the Transportation Security Administration. Lawmakers blocked the Agriculture Department from closing six research facilities. And the Environmental Protection Agency is barred from issuing rules on methane emissions from large livestock operations. There's money to modernize nuclear bombs, help with a Syrian refugee crisis and repair the iconic cast iron dome of the Capitol.

It cuts off funding for high-speed rail projects that Republicans think are expensive boondoggles and denies the Obama administration funding for International Monetary Fund reforms that would give emerging economies like China, India and Brazil more sway with IMF decisions.

Veterans' programs get an almost 4 percent increase fueled by medical programs and a provision exempts that disabled veterans and surviving military spouses from a pension cut enacted last month. But Boehner signaled in a brief hallway conversation with The Associated Press that he would oppose a broader drive to repeal the entire pension provision, which saves $6 billion over the coming decade by reducing the annual cost-of-living adjustment for working age military retirees by 1 percentage point.

The bill adheres to Boehner's edict against earmarks, the parochial provisions that used to carve out billions of dollars each year for lawmakers' districts and states. Earmarks, which blossomed when Republicans controlled Congress over 1995-2006, had created a "pay-to-play" culture in which lobbyists and their business clients sometimes appeared to trade campaign money for government cash. Whether powerful lawmakers have used their influence more privately to sometimes achieve the same ends is an unanswered question in Washington.

The National Institutes of Health's proposed budget of $29.9 billion falls short of the $31 billion budget it won when Democrats controlled Congress. Democrats did win a $100 million increase, to $600 million, for so-called TIGER grants for high-priority transportation infrastructure projects, a program that started with a 2009 economic stimulus bill.

Civilian federal workers would get their first pay hike in four years, a 1 percent cost-of-living increase. Democrats celebrated winning an addition $1 billion over last year for the Head Start early childhood education program and excluding from the bill a host of conservative policy "riders" advanced by the GOP.

Rogers won two provisions backed by the coal industry. One would block the EPA and Corps of Engineers from working on new rules on "fill material" related to the mountain top removal mining. Another would keep the door open for Export-Import Bank financing of coal power plants overseas.

Sen. Mike Lee, R-Utah, a tea party favorite who joined Cruz' September filibuster, didn't mention the measure's funding of Obamacare in a floor speech earlier in the week; instead he complained at length that the measure dropped funding of a federal program that sends payments to Western states in which much of the land is owned by the federal government and therefore can't be taxed by local governments.

(Copyright 2014 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.)