Senate Majority Leader Harry Reid leaves the White House after a closed-door meeting Friday between President Barack Obama and congressional leaders to negotiate the framework for a deal on the fiscal cliff.

WASHINGTON — The end game at hand, the White House and Senate leaders launched a final attempt at compromise Friday night in hopes of preventing a toxic blend of middle-class tax increases and spending cuts from taking effect at the turn of the new year.

“I am hopeful and optimistic” of reaching an agreement after months of gridlock, the Senate Republican Leader, Mitch McConnell of Kentucky, said after a meeting with President Barack Obama and top congressional leaders at the White House.

He said he hoped for a compromise that could be presented to rank and file lawmakers by Sunday, little more than 24 hours before the year-end deadline.

Senate Majority Leader Harry Reid said, “I’m going to do everything I can” to prevent the tax increases and spending cuts that threaten to send the economy into recession.

He cautioned, “Whatever we come up with is going to be imperfect.”

Success was far from guaranteed in an atmosphere of political mistrust — even on a slimmed-down deal that postponed hard decisions about spending cuts into 2013 — in a Capitol where lawmakers grumbled about the likelihood of spending the New Year’s holiday in the Capitol.

“The clock is ticking,” Sen. Max Baucus, chairman of the Senate Finance Committee, said in remarks on the Senate floor as Obama and congressional leaders were meeting several blocks away at the White House. “My message to them is simple. We can do this. We can get this done, and we must,” added the Montana Democrat.

Congressional Democrats said Obama was ready with a revised offer to present.

But that drew a denial from a person familiar with the talks, who said the president would review his proposal from a week ago, when he urged lawmakers to preserve tax cuts for most while letting rates rise above incomes of $250,000 a year. At the same time, Obama said lawmakers should extend unemployment benefits for the long-term jobless. The person was unauthorized to discuss the private meeting publicly and spoke on condition of anonymity.

The meeting lasted a little over an hour and neither the president nor the four lawmakers spoke with reporters before or immediately after the session.

The guest list included two Republicans, House Speaker John Boehner, and McConnell, and Democrats Reid and Rep. Nancy Pelosi of California, her party’s leader in the House.

The same group last met more than a month ago and emerged expressing optimism they could strike a deal that avoided the fiscal cliff. At that point, Boehner had already said he was willing to let tax revenues rise as part of an agreement, and the president and his Democratic allies said they were ready to accept spending cuts.

Since then, though, talks between Obama and Boehner faltered, the speaker struggled to control his rebellious rank and file, and Reid and McConnell sparred almost daily in speeches on the Senate floor. Through it all, Wall Street has paid close attention, and in the moments before the meeting, stocks were trading lower for the fifth day in a row.

The core issue is the same as it has been for more than a year: Obama’s demand for tax rates to rise on upper incomes while remaining at current levels for most Americans. He made the proposal central to his successful campaign for re-election, when he said incomes above $200,000 for individuals and $250,000 for couples should rise to 39.6 percent from the current 35 percent.

Boehner refused for weeks to accept any rate increases, and simultaneously accused Obama of skimping on the spending cuts he would support as part of a balanced deal to reduce deficits, remove the threat of spending cuts and prevent the across-the-board tax cuts.

Last week, the Ohio Republican pivoted and presented a Plan B measure that would have let rates rise on million-dollar earners. That was well above Obama’s latest offer, which called for a $400,000 threshold, but more than the speaker’s rank and file were willing to accept.

Facing defeat, Boehner scrapped plans for a vote, leaving the economy on track for the cliff that political leaders in both parties had said they could avoid. In the aftermath, Democrats said they doubted any compromise was possible until Boehner has been elected to a second term as speaker when the new Congress convenes on Jan. 3.

Apart from income tax rates, congressional officials in both parties said a handful of other issues were the subject of private talks in the Capitol. These included the Alternative Minimum Tax, which would effectively raise taxes on millions of upper-middle-class families unless Congress acts; as well as taxes on capital gains, dividends and estates.

In addition, benefits for the long-term unemployed are due to expire in the next few days, and doctors face the prospect of a deep cut in the fees they receive for treating Medicare patients unless legislation is passed to prevent it.

Further compounding the year-end maneuvering, there are warnings that the price of milk could virtually double beginning next year.

Congressional officials said that under current law, the federal government is obligated to maintain prices so that fluid milk sells for about $20 per hundredweight. If the law lapses, the Department of Agriculture would be required to maintain a price closer to $36 of $38 per hundredweight, they said. It is unclear when price increases might be felt by consumers.