President Trump on Tuesday ridiculed former vice president Joe Biden over accusations that he has touched women inappropriately, in a preview of the attacks Biden might face if he pursues a 2020 presidential bid.

During a freewheeling speech at a fundraiser for the National Republican Congressional Committee, Trump at one point told a story about a conversation he had with a general.

“I said, ‘General, give me a kiss.’ I felt like Joe Biden. But I meant it,” Trump said, prompting laughter from the crowd.

At another point in his remarks, Trump mentioned the 2020 White House race and said that the only Democratic candidate who is not a socialist is “being taken care of pretty well by the socialists” — a nod to unproven claims by some Biden supporters that the recent accusations against him are being pushed by his political rivals.

“I was going to say, ‘Welcome to the world, Joe. You having a good time, Joe?’ ” Trump said.

More than a dozen women have accused Trump of sexual misconduct. The most recent accusation came in February, when Alva Johnson, a former staffer on Trump’s presidential campaign, said Trump kissed her against her will in 2016. Trump has denied all of the allegations against him.

Trump himself spoke graphically about forcibly kissing and groping women during a 2005 conversation that was caught on tape and surfaced during the 2016 campaign.

Trump’s broadsides Tuesday night underscore the political peril for Biden as he nears an announcement on a potential 2020 bid. The former vice president has long been known for his intimate physical style, but the appropriateness of his behavior toward women is coming under increasing scrutiny.

Late last week, Lucy Flores, a former Nevada state legislator, penned an essay in which she said that Biden approached her from behind during a 2014 campaign rally, placed his hands on her shoulders and planted a “big slow kiss” on the back of her head. On Monday, Amy Lappos, a former congressional aide to Rep. Jim Himes (D-Conn.), said Biden put his hand around her neck and rubbed noses with her at a 2009 fundraiser.

Two more women, Caitlyn Caruso and D.J. Hill, have also accused Biden of touching them inappropriately, the New York Times reported Tuesday night.

Biden on Sunday said in a statement that he had offered “countless handshakes, hugs, expressions of affection, support and comfort” during his years in public life, “and not once — never — did I believe I acted inappropriately.”

During his nearly 90-minute speech Tuesday night, Trump took a number of swipes at Democrats — and also made some remarks that probably raised the eyebrows of members of his own party.

He took aim at the sweeping plan to combat climate change embraced by some Democrats, joking, “If they beat me with the Green New Deal, I deserve to lose.”

He also said that when he started running for president, the GOP was “the party of the rich person,” and claimed that Republican candidates were losing because there weren’t enough rich people.

Now, the Republican Party is “the party for all Americans . . . We’re the party of the American Dream,” Trump said.

He doubled down on his plan for Republicans to make a vote on a new health-care law their first act of the next Congress — despite the fact that congressional Republicans have little appetite to take on an issue that was a boon for Democrats in the 2018 midterms.

“You’re going to win your elections because of health care,” Trump told the crowd.

And he urged Republicans to be “more paranoid” about the way votes are counted in future elections, echoing the unfounded claims of widespread voter fraud he has made in the past.