The federal budget deficit is widening again after years of postrecession shrinkage, with its trajectory in the coming years uncertain as President-elect Donald Trump and congressional Republicans look to cut taxes and boost U.S. economic growth.

The U.S. ended the 2016 calendar year with a $580 billion deficit, according to Treasury Department data released Thursday, representing roughly 3.1% of U.S. gross domestic product. That was up from a deficit of around 2.6% of GDP at the end of the 2015 calendar year, and it ended a six-year streak of annual declines.

The nonpartisan Congressional Budget Office last year predicted rising budget deficits over the next decade as outlays grow faster than tax receipts and other revenue. The CBO foresees the deficit climbing from 3.1% of GDP in the current fiscal year, which began October 1, to 4.6% of GDP by the 2026 fiscal year.

But that projection assumes no major changes to current law and continued modest economic growth. The coming Trump administration has signaled that overhauling the tax code will be a priority along with boosting infrastructure investment, though it remains to be seen how that could affect economic growth, government revenues and the budget deficit.

Independent estimates show reduced revenue and wider deficits under tax plans proposed by House Republicans and Mr. Trump. The World Bank said this week that Mr. Trump’s proposed tax cuts could boost U.S. economic growth in 2017 and 2018. Many economists, however, say demographic trends and sluggish productivity gains will likely continue to restrain long-run growth.