WASHINGTON—President Trump said Thursday he would invoke his emergency authority to freeze pay for more than two million civilian federal workers next year, citing the need to restrain the growth of federal spending.

“We must maintain efforts to put our nation on a fiscally sustainable course, and Federal agency budgets cannot sustain such increases,” Mr. Trump said in a letter to Congress on Thursday.

Democrats and federal workers’ unions decried the Republican president’s move, coming at a time of vigorous economic growth and after Congress passed a sweeping tax cut that congressional scorekeepers estimate will increase the budget deficit by $1 trillion over a decade. Congress also reached a budget agreement this year to boost federal spending by nearly $300 billion in 2018 and 2019.

“Trump has the nerve to eliminate pay raises for federal employees to ‘put our nation on a fiscally sustainable course,’ ” said a spokesman for the Democratic National Committee, pointing to the GOP tax law. He called the move “yet another slap in the face to American workers.”

Under current law, federal civilian employees are set to receive a 2.1% across-the-board pay increase beginning on Jan. 1, 2019, but Mr. Trump said he is eliminating those raises. He also said he would scrap additional raises, which vary by location, aimed at bringing federal pay in line with private-sector salaries.