With time running out and trailing in the polls, President Trump needed the strongest possible showing in his final debate against Joe Biden. But in the face of a series of attacks, the former vice president parried the president with a strong performance that is likely to leave the presidential campaign little changed from where it was at the start.

Trump arrived knowing that a repeat of the performance in the first debate would cost him and seemed determined to present a different face. Biden came in knowing that simply holding his own would amount to a victory.

Supporters of both candidates were cheered by what they saw during the 90 minutes at Belmont University in Nashville. But if, at worst, the debate was judged a draw, that alone would be less than the president needed politically.

Trump threw everything he could think of at his rival, accusing Biden and his family of personal corruption and labeling him a do-nothing career politician. He was more disciplined than in the first debate and more focused in his attacks. He did what his advisers had hoped.

But Biden was well prepared as well, and in the face of those attacks he stood firm, offering rebuttals that repeatedly undercut or deflected the attacks and at times fact-checked assertions from that came from the president.

The tone of the debate was an improvement over their encounter in Cleveland, when the president constantly interrupted and often trampled on the rules. On Thursday night, there were plenty of clash points and pointed exchanges, but overall this was a more substantive debate, one that offered clear contrasts in philosophy, agendas and character.

The debate opened on the biggest issue of the year, the coronavirus pandemic, a topic that immediately put the president on the defensive. Trump continued to claim the country has rounded the corner in combating the virus, at a moment when cases are rising in nearly every state.

He argued in favor of reopening the economy and opening the schools and said Biden would try to keep the country closed indefinitely. “We have to open our country,” he said. “We’re not going to have a country.” To which Biden responded, “I’m going to shut down the virus, not the country.”

It was no surprise that the pandemic was a central topic in Thursday’s debate, with warnings from experts that, with winter approaching, even more Americans are likely to catch the virus. The issue remains Trump’s greatest weakness and has been ever since the public began to judge his handling of the issue negatively. Biden did what he could to remind voters of that record.

Biden was also strong on the general issue of health care and the threat that the Supreme Court might overturn the Affordable Care Act. Trump said he wanted to “terminate” Obamacare and “come up with a brand-new beautiful health care.” Biden could barely suppress a smirk. “You can’t do it in the ether,” he said, asserting that the president still does not have a plan that could do what he claims he wants.

Biden said that if the Affordable Care Act is overturned he would replace it with a version of the current law that would include a public option. When Trump suggested that Biden’s health-care plan would lead to a government takeover of the health-care system, Biden noted that he had opposed Medicare-for-all plans offered by his Democratic rivals during the nominating contest. “He thinks he’s running against somebody else,” Biden said of the president. “He’s running against Joe Biden.”

Trump was determined to raise the issue of Biden’s son Hunter and his business overseas and to tie Biden to it. He accused the former vice president of profiting from his son’s business, claiming he had gotten $3.5 million from Russia “and it came through Putin.” Biden insisted that was false. “I have not taken a penny from any foreign source ever in my life,” he said.

He sought to turn the issue on Trump, focusing on a recent report in the New York Times that revealed Trump has had a bank account in China. “I have released all of my tax returns, 22 years,” Biden said. “Go look at them, 22 years of my tax returns. You have not released a single solitary year of your tax return. What are you hiding?”

Biden defended his son’s business dealings, saying that “nothing was unethical” about them, though his son has said he made a mistake that gave an opening to critics of his father.

The two also clashed over immigration and the border, with the recent news that advocates have been unable to locate the parents of 545 children who were separated at the border. Trump claimed the children did not come across with their parents but were brought here by unscrupulous actors known as coyotes.

“Coyotes didn’t bring them over. Their parents were with them,” Biden said. “They got separated from their parents. And it makes us a laughingstock and violates every notion of who we are as a nation.”

No one was quite sure what Trump would be like on Thursday night. His performance in the Cleveland debate drew widespread criticism, as he constantly interrupted Biden and displayed a belligerent posture throughout the session. The combination of the debate and his coronavirus diagnosis proved to be a setback for the president politically, throwing up a roadblock to his hopes of gaining back ground in the battleground states.

In the days running up to Thursday’s debate, with polls showing Biden in the stronger position, Trump appeared to be in a sour mood. In a call with campaign staffers, he called Anthony S. Fauci “a disaster.” A week ago, he sparred angrily with NBC’s Savannah Guthrie during a televised town hall in Miami.

This week he walked out of an interview with Lesley Stahl of CBS’s “60 Minutes,” objecting to her sharp questioning and complaining that Biden has gotten kid-glove treatment. He also repeatedly attacked NBC’s Kristen Welker, the moderator of Thursday’s debate, claiming she would be unfair.

Though there were interruptions and personal jabs, Trump stuck to a more traditional game plan in the hope that he could begin to win over or win back voters he needs to secure a second term. If the latest polls are accurate, the president has considerable ground to make up, but a path still exists for him to win another electoral college majority, one that is essentially identical to the narrow path he followed to victory four years ago.

To get there, he must hold Florida, North Carolina, Arizona, Ohio and Iowa, all states he won in 2016 but that are now competitive. If he is able to do that, winning any of the three Northern states — Wisconsin, Michigan or Pennsylvania — would give him a narrow majority and a second term. A loss in any of those states, particularly Florida, North Carolina or Ohio, would put him in at a major disadvantage, though he could still win by carrying the trio of Northern states that secured his victory in 2016.

Trump has been trying to expand the map, hoping to add a state that he lost in 2016. His campaign targeted Minnesota early, but polls show him behind Biden there and his main targets recently have been Nevada and New Hampshire. So far he appears not to have made any serious progress.

With the debates now over and few undecided voters left in the country, both candidates will be focused on the last big challenge, which is to get every potential supporter to cast a ballot. Early voting in the states has produced long lines and big turnout — more than 47 million votes have been cast already, more than two-thirds of them mail ballots and the rest in person.

Biden appears to be banking more votes than the president, which means Trump will need a major boost from people who have not yet voted and especially those who plan to wait until Election Day. The president is hoping for a surge in turnout from supporters who voted for him in 2016 and like-minded Americans who did not. Whether he did enough on Thursday night to bring that about is the issue that now hangs over his hopes for reelection.