Joe Biden said that he would not seek a second term as president if his health deteriorates while in office.

A voter at a CNN town hall in Las Vegas, Nevada, on Thursday night asked the former vice president, 77, if he would commit to serving only one term.

"No, I wouldn't do that, but, I tell you what, you're going to be able to make a judgment," Biden said. "And, by the way, the two youngest people on the stage now are me and Buttigieg," he joked, referring to 38-year-old former South Bend, Indiana, Mayor Pete Buttigieg, the youngest candidate in the race.

Biden said, however, that he would not seek a second term if his health declined.

"I'm in pretty good health, but, look, I guarantee you this: If anything changed in my health, making it incapable for me to fully exert all the energy and mental acuity that was needed to be done, then I give you my word: I would not run again," Biden said.

If elected, Biden would be the oldest president in history. President Ronald Reagan, the current record-holder, was 77 when he left office.

Biden explained that part of his reasoning for not committing to one term was because it would make it harder to accomplish policy goals.

"Look, anybody who starts off saying, 'I'm only going to serve one term,' is already behind the eight ball because then you're a one-term president, and no one worries about what the hell's going to happen after that," Biden said.

He added that it is "totally legitimate" to consider candidates' ages and health, noting that several candidates are over 70 years old and that his young age was questioned when he ran for Senate in 1972, when he was 29.

Biden primary competitors Vermont Sen. Bernie Sanders and former New York City Mayor Michael Bloomberg are both 78, and Massachusetts Sen. Elizabeth Warren is 70.

"That's why I give all my medical records. OK. Everything," Biden said.

Biden released medical records that revealed he has a heart condition and high cholesterol but makes no mention of mental agility.