U.S. President Donald Trump answers a question about U.S. Supreme Court nominee Brett Kavanaugh during a meeting with Chilean President Sebastian Pinera in the Oval Office of the White House in Washington, U.S., September 28, 2018. REUTERS/Joshua Roberts

WASHINGTON (Reuters) - U.S. President Donald Trump signed a massive spending bill on Friday, providing hundreds of billions of dollars for the Department of Defense and averting the threat of a federal government shutdown at least until December.

The bill includes $675 billion to fund the Defense Department for the full year ending on Sept. 30, 2019, as well as additional funds for the wars in Afghanistan and elsewhere, and $180 billion for the Labor, Health and Human Services and Education Departments.

It also includes a measure to keep the federal government open until at least Dec. 7, even though Congress has not yet passed full-year appropriations bills covering every department.

Trump had threatened to let the government shut down on Oct. 1 if the U.S. Congress did not approve money he wanted to build a wall along the U.S.-Mexico border.

But he said earlier this week, after the measure passed the Senate and House of Representatives, that he would sign the bill and not let the government shut down when the current fiscal year ends at midnight on Sunday.

The wall issue could come up again before December, because funding for the Department of Homeland Security has yet to be finalized for fiscal 2019.