The US senate has agreed on a two-year 400 billion dollar (£286 billion) budget deal which would provide huge increases on defence and domestic spending.

Senate majority leader Mitch McConnell was joined on the senate floor by top Democrat Chuck Schumer of New York as he announced the pact. The measure would contain almost 300 billion dollars (£215 billion) over current limits on defence and domestic accounts.

Mr McConnell said the measure would rewrite existing defence limits which had “hamstrung our armed forces and jeopardised our national security”.

The measure also contains almost 90 billion dollars (£64 billion) in overdue disaster aid and an increase in the US government borrowing cap that would prevent a first-ever default on its obligations.

The agreement is likely to be added to a stopgap spending bill that passed the House on Tuesday, aimed at averting a government shutdown on Thursday at midnight.

Mr Schumer called the agreement “a genuine breakthrough.”

However, it would not resolve the plight of immigrant “Dreamers” who face deportation after being brought to the US illegally as children.

As the Senate leaders were announcing their agreement, minority leader Nancy Pelosi of California was holding the floor in the House, declaring she would oppose the measure unless her chamber’s GOP leaders promised a vote on legislation to protect the younger immigrants.

That introduced doubts as to whether the plan could pass in House, where prominent GOP conservatives are also opposed to the higher spending.

Senate Democratic leaders have dropped their strategy of using the funding fight to extract concessions on immigration, specifically on seeking extended protections for the “Dreamer” immigrants. Instead, minority leader Mr Schumer went with a deal that would reap tens of billions of dollars for other priorities while hoping to solve the immigration impasse later.

The budget agreement would give both the Pentagon and domestic agencies relief from a budget freeze that legislators say threatens military readiness and training as well as domestic priorities such as combating opioid abuse and repairing the troubled healthcare system for veterans.

The core of the agreement would shatter tight “caps” on defence and domestic programmes funded by Congress each year. They are a hangover from a failed 2011 budget agreement and have led to military readiness problems and caused hardship at domestic agencies such as the Environmental Protection Agency and the IRS.

The agreement would give the Pentagon an 80 billion dollar (£58 billion) increase for the current budget year for core defence programmes, a 14% increase over current limits that exceeds President Donald Trump’s request by 26 billion dollars (£18.8 billion). Non-defence programmes would receive about 60 billion dollars (£43 billion) over current levels. Those figures would be slightly increased for the 2019 budget year beginning on October 1.

“For the first time in years, our armed forces will have more of the resources they need to keep America safe,” said Mr McConnell.

“It will help us serve the veterans who have bravely served us. And it will ensure funding for important efforts such as disaster relief, infrastructure, and building on our work to fight opioid abuse and drug addiction.”

Mr Trump’s budget last year proposed a 54 billion dollar (£40 billion) increase for defence, proposing to slash non-defence accounts by the same amount.

Ms Pelosi took to the House floor for more than three hours, and said she would oppose the almost-completed budget pact even though it would boost funding for many domestic priorities favoured by Democrats. She declared the agreement “does not have my support, nor does it have the support of a large number of members of our caucus”.

Ms Pelosi said the House should debate immigration legislation and noted that Senate Republicans have slated a debate on the politically freighted subject starting next week,

“Let Congress work its will,” Ms Pelosi said. “What are you afraid of?”