In a tweet in May 2015, a month before he formally began his campaign, Mr. Trump discussed another Republican’s promises to keep entitlements intact, former Gov. Mike Huckabee of Arkansas.

“Huckabee is a nice guy but will never be able to bring in the funds so as not to cut Social Security, Medicare & Medicaid,” Mr. Trump tweeted. “I will.”

In his formal campaign announcement that year, he said, “Save Medicare, Medicaid and Social Security without cuts. Have to do it. Get rid of the fraud. Get rid of the waste and abuse, but save it.”

Democrats are also wrangling over entitlement programs, which are among the fastest growing federal expense. Senator Bernie Sanders from Vermont and former Vice President Joseph R. Biden Jr. have been arguing for days over Mr. Biden’s past comments about cuts to Social Security, a reminder of how sensitive the issue is for voters.

Republicans have largely avoided talking about rolling back entitlement programs since Mr. Trump became president, assuming that doing so would be a non-starter. Following the $1.5 trillion tax cut that Republicans passed in 2017, some suggested that they would quickly turn to reduce the cost of Social Security, Medicare and Medicaid.

Those ideas gained little traction and federal spending has continued to grow.

The Treasury Department said last week that the federal budget deficit surpassed $1 trillion in 2019. It was the first calendar year since 2012 that the deficit topped that threshold. To help finance deficits, which require the government to sell debt, the Treasury Department plans to begin issuing 20-year bonds.

Other Trump administration officials have been more careful in discussing the need to cut spending on entitlement programs. Treasury Secretary Steven T. Mnuchin demurred earlier this month when pressed on CNBC about how to scale back spending on entitlements.

“All I’m going to say is that we talked about there needs to be bipartisan review of government spending and that’s something at the appropriate time we’ll look at,” Mr. Mnuchin said.