It is just the sort of fight Mr. Biden has been spoiling for: a head-to-head contest with the incumbent on an issue that elevates Mr. Biden into a statesmanlike role, well above the Democratic primary fray and all the sniping candidates and liberal litmus tests therein.

For Mr. Trump’s advisers, it was one more example of the president’s inability to resist offering what amounts to an in-kind contribution to a Democrat who, according to their own polling, is positioned to soundly defeat them next year.

The president, though, has told advisers he believes he can portray Mr. Biden, a longtime Washington veteran, as representative of an ossified political class the same way he did Hillary Clinton, wounding him with enough attacks and put-downs that Mr. Biden will either stagger into the general election or collapse in the primary…

“In a Democratic primary, attacks from President Trump are the best thing that can happen to you,” Mr. Gorman said. “It elevates you, gives you a huge fund-raising boost and sucks the oxygen from your competitors.”