WASHINGTON—President Barack Obama's budget speech Wednesday had a clear but unnamed political target: Rep. Paul Ryan (R.,Wis.) and the conservative budget he has written for his party.

In a critique that delighted many liberals and infuriated conservatives, Mr. Obama portrayed Mr. Ryan's ambitious plan to cut the deficit—by overhauling Medicare and Medicaid while keeping upper-income tax rates low—as a gift to the nation's millionaires at the expense of the neediest in America.

Mr. Ryan and other Republicans viewed the speech as an unexpectedly partisan attack that undercut already thin hope that they would agree to a grand bipartisan deal to address the nation's debt problems.

Even before Mr. Obama's speech, Mr. Ryan was throwing cold water on the prospects of a grand bargain, despite growing hopes such a deal might be on the horizon before the 2012 elections.

Pointing to vast differences between the parties on health care and tax policy, Mr. Ryan said in an interview just hours before the president's speech, "It's hard to imagine we're going to have a global agreement."