WASHINGTON — The White House and congressional leaders have reached a new budget deal that calls for raising federal spending levels and lifting the debt ceiling for two years, potentially averting what could have been another nasty partisan battle this fall.

President Donald Trump announced the agreement Monday on Twitter.

“I am pleased to announce that a deal has been struck with Senate Majority Leader Mitch McConnell, Senate Minority Leader Chuck Schumer, Speaker of the House Nancy Pelosi, and House Minority Leader Kevin McCarthy - on a two-year Budget and Debt Ceiling, with no poison pills....” Trump wrote.

“This was a real compromise in order to give another big victory to our Great Military and Vets!” Trump he said.

The deal, which would require congressional approval, includes a two-year extension of the debt ceiling and would lift the threat of deep, automatic spending cuts that have hung over budget negotiations since Congress approved them several years ago as a way to force compromise.

The deal would raise spending by about $320 billion above what would have been spent without the agreement.

The White House and members of Congress agreed to include no “poison pill” riders that could blow up progress on future spending legislation.

Pelosi and Schumer used a joint statement to say the agreement would “enhance our national security and invest in middle class priorities that advance the health, financial security and well-being of the American people.”

McConnell said he intended to have the Senate vote on the agreement before the start of the annual August recess. McConnell said the Republicans’ top priority was military funding.

“This was our top objective: Continuing to restore the readiness of our armed forces and modernize our military to deter and defend against growing threats to our national security,” McConnell said.

Record high debt:Tax cuts, spending helping push national debt to historic high, new report says

Pelosi, who negotiated the deal with Treasury Secretary Steven Mnuchin, was spotted working on the agreement on a crowded plane traveling from Detroit to Washington after attending speaking events in the Midwest.

The flight was delayed for three hours because of weather conditions in the nation’s capital and throughout that marathon delay, Pelosi had her cell phone jammed to her ear, tediously going through each line of the deal on a call with Mnuchin and leaders of the House and Senate, according to one of her aides

A reporter snapped a photo of Pelosi, D-Calif., leaning on her arm rest while on the conference call.

The deal already is drawing criticism from federal budget hawks, who complained the agreement could significantly increase the federal debt over the next decade.

The nonpartisan Committee for a Responsible Federal Budget said the budget agreement "may be the worst in history."

“Members of Congress should cancel their summer recess and return to the negotiating table for a better deal,” said Maya MacGuineas, the group's president. “If they don’t, those who support this deal should hang their heads in total shame as they bolt town. This deal would amount to nothing short of fiscal sabotage.”

Contributing: Christal Hayes

Record debt:National debt tops $22 trillion for the first time as experts warn of ripple effects

Making your savings count:15 ways to make your savings last in retirement and keep pace with inflation