The Senate on Thursday passed a bipartisan two-year budget deal that would hike federal spending on defense and an array of other domestic programs, but also add to the soaring government debt.

Defense spending will see a $22 billion bump in the next fiscal year — up to $738 billion — and increase to $740.5 million the following year. Meanwhile, non-defense or domestic programs — ranging from border patrol and veterans’ health care to cancer research, space exploration and transportation improvements — would rise from the current $605 billion this year to $632 billion next year and $634.5 billion the following year.

The discretionary programs do not include trillions of dollars spent each year on mandatory programs, including Social Security retirement benefits and Medicare and Medicaid.

But the total spending for fiscal year 2020 would be roughly $4.67 trillion pending the completion of appropriations bills and the deficit is expected to be about $1 trillion.

Leading up to the vote, President Trump tweeted his seal of ­approval.

“Budget Deal is phenomenal for our Great Military, our Vets, and Jobs, Jobs, Jobs! Two year deal gets us past the Election. Go for it Republicans, there is always plenty of time to CUT!” wrote Trump, who was expected to sign the legislation, which passed 67-28.

Since Trump took office in January 2017, US debt has risen by roughly $2.5 trillion and was climbing above the current $22.5 trillion mark — a level some experts see as dangerously high.

“This may well be the most fiscally irresponsible thing we’ve done in the history of the United States,” said Sen. Rand Paul (R-Ky.), who voted against the bill.

Prior to the final vote, the Senate voted on an amendment sponsored by Paul that would balance the budget. It was voted down 70-23.

The Senate vote now allows members of the upper chamber to go home for August recess.

The House voted last week on the package and left town last ­Friday.

Members of the Democratic Party did the heavy lifting in the House, with 132 Republicans voting against the bill compared to just 16 Democrats. It ultimately passed with a vote of 284-149.

Twenty-three Republicans voted against the bill in the Senate.

As part of the bill, the statutory limit on Treasury Department borrowing would be suspended until at least July 31, 2021, in an attempt to erase any possibility of a default on debt through the November 2020 ­election.

The bill also would make it unlikely that Trump would fulfill his 2016 campaign vow to erase government debt within eight years. but that debt would significantly rise during his current four-year term in office.

In September, Congress will still have to work out how the money will be distributed to specific ­programs.

Failure to do so by Sept. 30 could lead to new partial government shutdowns.