WASHINGTON — President Donald Trump finalized an $854 billion spending bill on Friday that fully funds the military for fiscal 2019 and prevents a government shutdown next week, accomplishments that congressional leaders have called important and laudable.

But Trump’s signature came with one final attack on Democrats over the spending measure, lamenting lawmakers’ decision not to include extra money in the appropriations package for his planned wall along the southern U.S. border.

“Unfortunately, the radical Democrats refuse to support border security and want drugs and crime to pour into our country,” he said in a statement after signing the bill.

The comments came just a week after Trump took to social media to blast “this ridiculous Spending Bill,” raising fears of a presidential veto on Capitol Hill. Instead, Trump largely praised the measure on Friday, calling it “important legislation to rebuild our military” and promote other domestic priorities.

The appropriations measure includes $674 billion in defense funding for fiscal 2019, and marks the first time in a decade Congress has finalized the spending measure before the start of the new fiscal year.

The measure funds a 2.6 percent pay raise for troops starting next January and a boost in military end strength of 16,400 spread across the active-duty and reserve forces.

Trump, in his statement, praised the measure for including “93 new F-35 Lightning Joint Strike Fighters, 142 Apache and Black Hawk helicopters, and 13 Navy battle force ships — made right here in the USA.”

In a statement after the signing, House Armed Services Committee Chairman Mac Thornberry, R-Texas, praised the president for pushing for the funding increases in his budget request and past public statements.

“By funding our military in full and on time, we can begin to restore its strength, agility, and effectiveness,” he said. “As I have said before, the task before us now is to make full, on time funding of our military the rule in Washington, and not the exception.”

The spending bill also includes full-year funding for the departments of Health and Human Services, Education and Labor, as well as bridge funding for a handful of other government agencies to keep them operational through Dec. 7.

Last week, Trump signed into law a separate package that included full-year funding for the Department of Veterans Affairs and for military construction projects.