Sen. Bernie Sanders (I-Vt.) is interviewed by reporter Robert Costa on Tuesday at a Washington Post Live event. (Kaz Sasahara/For The Washington Post)

Presidential candidate Bernie Sanders took aim at President Trump and Democratic rival Joe Biden in an hour-long interview with The Washington Post on Tuesday, in which he sought to lay out his vision for the presidency at a precarious moment for his campaign.

The independent senator from Vermont, who is running for the Democratic Party’s nomination, sharply criticized Trump’s racist remarks about four minority members of Congress, and he accused Trump of making a calculated political decision to sow division across the country to benefit his reelection campaign.

“Trump may be crazy, but he’s not stupid,” Sanders said. “I think what he believes is it is a good strategy to divide people up.”

Sanders also took on Biden, offering one of the most comprehensive policy and political critiques of his Democratic presidential rival to date. He confronted Biden over his health-care plan, his foreign policy record and his ability to win crucial voters in Upper Midwest states Trump carried.

He called Biden’s criticisms of Sanders’s Medicare-for-all proposal “absurd” and attacked the less sweeping health-care alternative Biden has put forward. “Times change, and we have got to go further,” Sanders said.

The interview, which was broadcast live online, came at a moment Sanders has shown signs of struggling to adapt to a fast-changing race in which others candidates in the crowded Democratic field have seized momentum.

Sanders’s second run for president got off to a fast start February and March, drawing massive and raucous crowds, strong polling numbers and gobs of cash into his campaign coffers.

But recent surveys show that his once clear grip on second place to Biden has disappeared — and one poll this week showed him slipping to fifth place in New Hampshire, a state he won decisively over Hillary Clinton in the 2016 primary. Sanders on Tuesday dismissed that poll, conducted by Saint Anselm College, as an outlier.

After leading the Democratic pack in fundraising during the first quarter of the year, Sanders was outraised by three competitors in the second quarter. Among those who outpaced him was Sen. Elizabeth Warren (Mass.), whose appeal to left-leaning voters poses a unique threat to Sanders.

In the interview, Sanders sought to underscore his ability to defeat Trump in the general election, although he conceded Biden also runs strongly against the president. When it comes to Trump’s rhetoric, Sanders stated his oft-repeated assertion that Trump has used racist language like no other president in modern history.

“Can anyone imagine a conservative president like Bush bringing forth these racist comments?” Sanders asked. He then slammed Republicans for their largely muted response to Trump’s comments. “Look, if there’s anything sadder than having a racist, bigoted President, it is seeing the collapse of the Republican Party, in terms of suddenly becoming the Trump party and living in fear of Trump,” he said.

Congressional Democrats, Sanders said, should proceed with an impeachment inquiry against the president, but he warned that impeaching Trump could play into the president’s hands politically.

Sanders declined to weigh in deeply on the recent racially-charged infighting among Democratic House members and aides that preceded Trump’s racist remarks. “You’re getting inside, inside the Beltway,” he said. But he added that he does not think House Speaker Nancy Pelosi (D-Calif.) is a racist.

When the discussion turned to Biden, Sanders was much more willing to engage in a policy-minded critique. The interview came as tensions between Sanders and Biden are rising amid clashes over health care. Biden released a plan this week that would expand the Affordable Care Act with an optional public insurance program and warned that shifting to a more sweeping Medicare-for-all initiative like Sanders is pushing would be risky.

“Of course he’s wrong,” said Sanders of Biden’s health-care pitch. He said he welcomed a chance to continue debating the topic with the former vice president.

Sanders and his top aides have strongly rebutted Biden and argued that the former vice president’s plan would not go far enough in ensuring Americans have the coverage they need. Sanders is scheduled to deliver a speech in Washington on Wednesday defending Medicare-for-all against critics. The single-payer program has long been one of his signature policy proposals.

Biden’s campaign says his plan would cost about $750 billion over 10 years. Asked what his own plan would cost, Sanders said it would be somewhere between $30 trillion and $40 trillion over 10 years. He stressed that his plan would also offer huge cost savings in health care, even if it would result in a tax hike on middle-class Americans. He declined to offer specifics of what the tax impact might be.

Sanders also sought to sharpen the contrast between himself and Biden on foreign policy and trade, noting the former vice president’s vote authorizing the Iraq War and far-reaching trade deals he opposed.

“How is that going to play in the Midwest?” asked Sanders, speaking of Biden’s trade record.

At times in Tuesday’s interview, Sanders was brusque. At other moments, he was jocular.

Some voters have said Sanders’s age — 77 — is a factor that makes him less appealing to them as a candidate. He took on this critique, saying that is only one of many factors voters ought to consider.

He said he is in good health and could not remember the last time he missed work because of illness. He jokingly challenged Trump to a mile run.

The Vermont senator has campaigned much as he did in 2016 — railing against foes in both parties, playing up his independent steak and focusing mostly on transformative ideas such as increasing the minimum wage, providing universal health care and reining in the power of wealthy corporations.

In the interview, Sanders was critical at large corporations, saying Amazon “is moving very rapidly to be a monopoly.” If elected president, Sanders said, his Department of Justice would move to break up big companies like Amazon and Facebook.

(Amazon founder and chief executive Jeff Bezos owns The Washington Post.)

He declined to weigh in on the recent dispute between Biden and Sen. Kamala D. Harris (D-Calif.) over Biden’s comments about busing and working with segregationist senators. But Sanders defended his own comments about busing from decades ago.

Sanders plans to return to Iowa this weekend, a state where he nearly defeated Clinton in 2016 but where polls show him trailing behind other candidates this time around. He is scheduled to attend an AARP candidate forum, several campaign office openings, a picnic and a county fair, among other stops.

Much as he did in 2016, Sanders has often cast has himself as a target of the political establishment. He did so again on Tuesday.

“I don’t say it’s aligned against me in a paranoid way,” he said, adding, “We are taking on Wall Street, we are taking on the insurance companies.”