WASHINGTON — White House officials and congressional lawmakers are nearing a deal that would boost government spending levels over the next two years and raise the federal borrowing limit. If passed by Congress and signed by President Donald Trump, it would avert a default crisis this fall and avoid automatic spending cuts next year.

The agreement would raise spending by $320 billion, compared with the strict spending levels established in the 2011 Budget Control Act and set to go into effect next year without legislative action, according to three people familiar with the negotiations who requested anonymity to discuss the unfinished deal.

The accord, which negotiators hope to enact before Congress leaves for its August recess, includes equal increases in domestic and military spending, a key demand of House Speaker Nancy Pelosi’s, according to one person familiar with the talks. It would also include offsetting spending cuts of about $75 billion, far lower than the $150 billion that some White House officials initially demanded.

The deal would lift the debt ceiling high enough to allow the government to keep borrowing for two more years, punting the next showdown past the 2020 elections.

People familiar with the negotiations stressed that the talks were continuing, but all sides have strong incentives to come together quickly. Without action, Congress will either have to postpone departure for its monthlong August recess or rush back early to finish the deal before the government runs out of money, which could be as early as September.

At the White House on Monday, Trump said “we are having very good talks” on the budget and the debt limit. He said he was pleased with additional investment in the military.

Pelosi and Treasury Secretary Steven Mnuchin, who have led the negotiations in private phone calls over the past week, will have to sell a deal to their parties before an anticipated House vote this week, before that chamber leaves Friday. The Senate is scheduled to leave for its recess next week.