(Updates with Obama statement, adds PIX, TV)
By David Lawder and Susan Cornwell
WASHINGTON, Oct 30 (Reuters) - U.S. President Barack Obama early Friday won congressional passage of legislation that lifted the threat of a default on government debt through the end of his presidency and a budget blueprint easing strict spending caps through September 2017.
The Senate voted 64-35 to approve the measure, which was negotiated over the past few weeks by the White House and congressional leaders, including former House Speaker John Boehner, who retired from Congress.
Obama will sign the bill into law as soon as he receives it, the White House said in a statement.
Without action by Congress, the Treasury Department would have exhausted the last of its borrowing capacity on Nov. 3, according to Treasury Secretary Jack Lew, and risked default on U.S. obligations within days that would roil global financial markets.
The two-year budget provision provides new top-line spending levels for Congress for the fiscal year that began Oct. 1 and the one starting Oct. 1, 2016.
It loosens budget caps, allowing an additional $80 billion in spending on military and domestic programs over the two years.
But lawmakers still need to allocate that money among thousands of budget-line items. They face a Dec. 11 deadline, when existing spending authority by government agencies expires, and a spirited fight is expected.
Obama called on Congress to build on the budget "by getting to work on spending bills that invest in America's priorities without getting sidetracked by ideological provisions that have no place in America's budget process."
Conservative Republicans are likely to try to attach controversial policy add-ons, such as prohibiting funding for women's healthcare provider Planned Parenthood to punish the group for an abortion-related controversy involving fetal tissue.
Some may also try to undo Dodd-Frank Wall Street reforms enacted after the 2008-09 financial crisis or prohibit new regulations on carbon emissions.
During Senate debate on Thursday, conservatives railed against the budget and debt limit bill.
Republican Senator Rand Paul, who is running for the Republican nomination for president, complained in a floor speech: "The right's going to get more military money. The left's going to get more welfare money. The secret handshake goes on and the American public gets stuck with the bill."
Senator Ted Cruz, a rival Republican presidential hopeful, returned to Washington from the campaign trail to accuse Republican majorities in Congress of "handing the president a blank credit card for the remainder of his tenure."
Senate Majority Leader Mitch McConnell, a Republican who helped negotiate the bill, praised the measure for rejecting tax increases and noted that the added spending would be offset by savings elsewhere in the government.
He also said it would "enact the most significant reform to Social Security since 1983." The estimated $168 billion in long-term savings from the program would be achieved by clamping down on medical fraud and excess claims associated with disability benefits. See Factbox: (Additional reporting by Richard Cowan and Susan Heavey; Editing by Larry King and Jeffrey Benkoe)