WASHINGTON (Reuters) - The U.S. Senate voted overwhelmingly on Tuesday to pass a mammoth spending package including $675 billion for the Defense Department and a measure to keep the entire federal government open until Dec. 7, a step toward avoiding a Sept. 30 shutdown.

FILE PHOTO: A view from the U.S. Senate side shows the U.S. Capitol Dome (L) in Washington, U.S., October 4, 2013. REUTERS/Jonathan Ernst/File Photo

The Senate voted 93 to 7 for the $855 billion package, combining the two largest annual spending bills - for the Labor, Health and Human Services and Education departments as well as the Pentagon.

It also includes a continuing resolution that would cover government operations not otherwise funded before the current fiscal year ends on Sept. 30, giving lawmakers more time to finalize next year’s spending.

To become law, the package would have to pass the House of Representatives, which is out of Washington until Sept. 25, and then be signed by President Donald Trump.

Trump has threatened to let the government shut down on Oct. 1 if he does not get the money he wants to build a wall along the U.S.-Mexico border.

However, a veto could lead to an embarrassing government shutdown weeks before the Nov. 6 mid-term elections, when control of Congress by Trump’s fellow Republicans is up for grabs.

It also would delay an increase in spending for the military, something strongly backed by most Republicans and a policy goal of Trump’s.

“Critically, after subjecting America’s all-volunteer armed forces to years of belt-tightening, this legislation will build on our recent progress in rebuilding the readiness of our military and investing more in the men and women who wear the uniform,” the Senate’s Republican majority leader, Mitch McConnell, said in a speech urging support for the legislation.

Trump campaigned for president in 2016 vowing to build a wall that he said Mexico would finance.

But Mexico has balked and Trump instead has had to turn to Congress for construction funds. Lawmakers provided $1.57 billion this year for physical barriers and related technology along the southwest border.

Some have estimated the total cost of the edifice at more than $24 billion.

The White House has not yet indicated whether Trump would sign the measure, if it is also approved by the House.