WASHINGTON (Reuters) - The U.S. Senate, rushing to meet a looming deadline, approved and sent to President Donald Trump a $1.4 trillion package of fiscal 2020 spending bills that would end prospects of government shutdowns at week’s end when temporary funding expires.

The U.S. Flag lies in front of the U.S. Capitol dome prior to a vote in the U.S. House of Representatives on two articles of impeachment against U.S. President Donald Trump in Washington, U.S., December 18, 2019. REUTERS/Joshua Roberts

By strong bipartisan margins and with White House backing, the Senate passed the two gigantic funding bills for government programs through Sept. 30.

Trump is expected to sign both bills into law before a midnight Friday deadline.

Notably, the Pentagon would get $738 billion for military activities - $22 billion more than last year.

Investments in domestic programs range from child nutrition and college grants to research on gun violence for the first time in decades and money for affordable housing programs that Trump had opposed.

The legislation also contains a series of new initiatives, including funding for Trump’s military Space Force, raising the age for purchasing tobacco products to 21 from the current 18, and repealing some taxes that were intended to fund the Affordable Care Act health insurance, popularly known as Obamacare.

About a year ago, the U.S. government plunged into a record-long, 35-day partial shutdown after Congress refused to give Trump the money he wanted to build a U.S.-Mexico border wall - one that he previously had insisted Mexico would finance.

This time around, money for border security would stay level at $1.37 billion, far below what Trump had sought.

Earlier this year, angered by Congress’ refusal to give him the wall money, Trump declared an “emergency” and took funds from other accounts appropriated by Congress and used them to build part of the border wall that was a central promise of his 2016 presidential campaign.

Congressional and White House negotiators reached a deal on the spending bills to avert government shutdowns just days before Washington plunged into a different kind of political crisis: the Democratic-controlled House of Representatives approving articles of impeachment against Trump, a Republican.

With Democrats and Republicans trying to demonstrate that they can get at least some legislative work done amid Trump’s impeachment, the administration and Democrats also worked out differences over a U.S.-Mexico-Canada free trade agreement, making for a flurry of pre-Christmas break action in Washington.

The $1.4 trillion in spending for so-called “discretionary” programs, up from $1.36 trillion last year, is separate from “mandatory” programs like Social Security retirement benefits, which are automatically funded.

The higher spending, coupled with tax cuts enacted in 2017, are contributing to widening budget deficits. The government spent $984 billion more than it took in during the last fiscal year that ended on Sept. 30, and the non-partisan Congressional Budget Office projects annual budget deficits averaging $1.2 trillion over the next decade.

A rapidly-rising U.S. national debt now stands at $23.1 trillion, a level that some experts fear could eventually hobble the economy.