WASHINGTON — Top leaders of both parties in Congress made progress Tuesday on two must-do items on the legislative agenda: averting automatic budget cuts and meeting a deadline later this year to increase the government’s borrowing limit.

But after a flurry of optimism at midday, a deal proved elusive after an initial look at the numbers, with Democrats demanding dollar-for-dollar increases for defense and nondefense accounts plus billions of dollars more for the Census and veterans health care.

Senate Majority Leader Mitch McConnell (R., Ky.), who’s been a key force in getting budget negotiations up and running, said both the debt limit increase and the outlines of a two-year spending agreement would likely be merged into one package if a deal can be worked out.

Driving the bipartisan talks is the desire to avoid automatic spending cuts that threaten to hit the Pentagon and other federal agencies with budget reductions averaging 10 percent. At the same time, increasing the debt limit is required to avert a first-ever, market-quaking default on government obligations like interest payments and Social Security benefits.

It would also minimize the chances of a repeat of the 35-day government shutdown of December and January.

"The American people have given us divided government," McConnell said. "We've got to talk to each other."

Tuesday’s meeting included Treasury Secretary Steven Mnuchin, acting White House chief of staff Mick Mulvaney, and the top four leaders of Congress, including powerful House Speaker Nancy Pelosi (D., Calif.). They returned for a second session later Tuesday and adjourned with plans to reconvene soon.

“We’re making progress,” added House Minority Leader Kevin McCarthy (R., Calif.).

McConnell met with President Donald Trump last week and warned him that failure to reach a pact with Democrats could lead to endless bickering over the length of stopgap measures to prevent a government shutdown or put the government on course for $71 billion in cuts to the Pentagon.

The goal is to set an overall limit for agency budgets appropriated by lawmakers every year to permit the annual round of appropriations bills, expected to total more than $1.3 trillion, to advance with bipartisan support in both the House and Senate. It would represent the fifth two-year budget agreement since a 2011 budget and debt bill set the stage for much-reviled automatic cuts known as sequestration. Without an agreement, the automatic cuts would total $125 billion.

In his March budget submission, Trump employed bookkeeping gimmicks to protect the defense budget and called for sweeping cuts to domestic programs. Just last week, he decided he went too far in cutting popular environmental restoration programs for Florida's Everglades and the Great Lakes and reversed those cuts, along with cuts to the Special Olympics that were widely panned.

Trump's budget was universally seen as a nonstarter with Democrats controlling the House and didn't have many fans on the GOP side, either.

McConnell went out of his way to say Mnuchin is taking the lead for the administration rather than Mulvaney, a former tea party congressman, or hard-line White House budget director Russell Vought.

"I'm hopeful and optimistic that the secretary of the Treasury speaks for the president in these discussions and we hopefully soon will reach an agreement," McConnell said.

Details on the discussions were closely held, though top Senate Democrat Chuck Schumer (D., N.Y.) said GOP negotiators will have to offer more for health care, infrastructure, environmental protection, and other programs favored by Democrats if a deal is to be had.

Schumer and Pelosi issued a statement Tuesday evening that demanded "parity" between military accounts favored by Republicans and domestic programs dear to Democrats — plus up to $7 billion for the decennial U.S. Census and an additional $10 billion or so for a relatively new program that permits veterans to see private-sector doctors.

Schumer and Pelosi's statement said, "Conversations among the Congressional leaders and Trump Administration officials were productive. We look forward to continuing to meet to discuss how we can best address the needs of hard-working families, as we again work across the aisle to avert sequestration."

Republicans recoiled at the numbers, though everyone remains at the table.

Efforts to raise the spending caps and government’s borrowing limit are often linked to move them through Congress. Pelosi and McConnell are veterans of every prior round, and Pelosi carries a strong hand in the talks since Mnuchin is eager to lift the debt ceiling with a minimum of drama.