HANOVER, N.H. — Former vice president Joe Biden, returning to this crucial primary state and attempting to put the focus on the foibles of President Trump, took an unusual departure toward the end of a 70-minute dive into health-care policy by asking the crowd to imagine the assassination of Barack Obama.

“None of you . . . women are old enough — but a couple of you guys are old enough,” he said during a town hall at Dartmouth College. “I graduated in 1968. Everybody before me was, ‘Drop out, go to Haight-Ashbury, don’t trust anybody over 30, everybody not get involved.’ No, I’m serious. I know no woman will shake her head and acknowledge it. But you guys know what I’m talking about. Right? But then what happened?”

The front-runner for the Democratic presidential nomination referenced the assassinations of two of his political heroes, Martin Luther King Jr. and Robert F. Kennedy — who was killed while running for president.

“Imagine what would have happened if, God forbid, if Barack Obama had been assassinated after becoming the de facto nominee,” he continued. “What would have happened in America?”

The comment — which, as Biden’s campaign pointed out with a video, came on the 11th anniversary of Obama naming Biden as his running mate — then led to him speaking about the 1970 shootings of demonstrators at Kent State University, and a new era of activism.

Biden then said that he was a supporter of women’s rights and the Equal Rights Amendment, which he said led to some suspecting he was gay.

“I remember because I was such a supporter of ERA in 1972,” he said. “Quote: ‘You know why Biden’s for the ERA? He’s probably gay.’ Not a joke. Everybody asks why I’m the first guy to come out for gay marriage. It’s real simple.”

He said as a teenager, his father took him to City Hall in Wilmington, Del. While they were in the car, Biden said he witnessed two men.

“I watched these two guys in business suits,” he recalled. “And they kissed each other. And then they walked away. I remember turning [and] looking at my dad. He said, you know, Joey, it’s easy. It’s simple. They love each other. They love each other. It’s a simple proposition.”

Biden has kept up a string of gaffes that have not yet had an effect on his standing in the race: Polls have kept him at the top and voters have said they are unbothered by his slips of the tongue.

But they could overshadow some of his salient messages about the potential for a looming recession and global uncertainty about America’s standing in the world.

At his second event on Friday night he appeared more focused.

“Day by day, we’re witnessing a president of the United States who is becoming more and more unhinged,” Biden said at a lakeside event as the sun went down and some listened from their canoes. “He calls himself the chosen one. This is almost bizarre.”

He continued: “He’s now at the G-7, which is about to convene. And he continues his irrational campaign to make America less respected.

“This is about more than the Democratic Party. This is about more than Democrats winning,” he said. “We literally, in my view, have to repair the American fabric that Trump is shredding every day.”

But Biden also caught himself amid another stumble that he wanted to prevent. He referenced his prior event, saying he was at the medical school, or perhaps it was just the campus but with medical students in the crowd.

He looked over at the press area.

“I want to be clear,” he said. “I’m not going nuts. I’m not sure whether it was the medical school or where the hell I spoke. But it was on the campus.”