WASHINGTON—U.S. officials no longer think the government will make money off the federal student-loan program and now project it will cost taxpayers tens of billions of dollars in coming years, according to a new congressional estimate.

The program is losing money after a surge of borrowers defaulting on loans or enrolling in plans that ultimately will forgive a portion of their debt.

The Congressional Budget Office said last week the program will cost taxpayers $31.5 billion over the next decade, once administrative costs are factored in. For years, the agency said the program would return a profit. The agency said a year ago that the program would return a profit of $8.7 billion over a decade. Bloomberg News reported the development Tuesday.

The CBO report estimates that overall, the government will get back all of the money it issues in loans, plus a bit of interest. But that figure is falling rapidly, and once administrative costs are factored in, the program overall will run a deficit, it says.

The losses represent a fraction of overall government spending, but they are mounting. And they are stirring concern within the Trump administration.