President Biden issued a broad and blistering attack against former President Donald J. Trump on Thursday, accusing his predecessor and would-be successor of inciting violence, seeking unfettered power and plotting to undermine the Constitution if he returns to office in next year’s elections.

In his most direct condemnation of his leading Republican challenger in many months, Mr. Biden portrayed Mr. Trump as a budding autocrat with no fidelity to the tenets of American democracy and who is motivated by hatred and a desire for retribution. While he usually avoids referring to Mr. Trump by name, Mr. Biden this time held nothing back as he offered a dire warning about the consequences of a new Trump term.

“This is a dangerous notion, this president is above the law, no limits on power,” Mr. Biden said in a speech in Tempe, Ariz. “Trump says the Constitution gave him, quote, the right to do whatever he wants as president, end of quote. I never heard a president say that in jest. Not guided by the Constitution or by common service and decency toward our fellow Americans but by vengeance and vindictiveness.”

Mr. Biden cited recent comments by Mr. Trump vowing “retribution” against his foes, accusing NBC News of “treason” and suggesting that the outgoing chairman of the Joint Chiefs of Staff, Gen. Mark A. Milley, might deserve to be put to death. The president also decried plans being developed by Mr. Trump’s allies to erode the independence of major agencies, wipe out much of the top ranks of civil service and make senior government officials personally loyal to him.

“Seizing power, concentrating power, attempting to abuse power, purging and packing key institutions, spewing conspiracy theories, spreading lies for profit and power to divide America in every way, inciting violence against those who risk their lives to keep Americans safe, weaponizing against the very soul of who we are as Americans,” Mr. Biden said. “This MAGA threat is a threat to the brick and mortar of our democratic institutions. It’s also a threat to the character of our nation.”

The gloves-off assault on Mr. Trump represented a marked shift for Mr. Biden, who has spent months mostly talking up the benefits of his policies while ignoring the race to choose a Republican nominee to challenge him. But repeated speeches claiming credit for “Bidenomics” have not moved his anemic approval ratings, as many voters tell pollsters they worry about the 80-year-old president’s age.

Democratic strategists have pressed the White House to draw a sharper contrast with Mr. Trump to remind Democrats and independents disenchanted with Mr. Biden of the stakes in next year’s election. Whatever Mr. Biden’s weaknesses, Democratic strategists maintain that swing voters will come back to him once they focus on Mr. Trump, 77, as the alternative.

Mr. Biden’s campaign released an ad assailing Mr. Trump as both the current and former presidents traveled separately to Michigan to meet with striking autoworkers. “He says he stands with autoworkers,” the ad says, showing images of Mr. Trump on the golf course, “but as president, Donald Trump passed tax breaks for his rich friends while automakers shuttered their plants and Michigan lost manufacturing jobs.”

The newly aggressive approach drew praise from critics of Mr. Trump. “Biden has never delivered a more important, powerful or eloquent speech than the one he has just given about the crucial importance of protecting American democracy,” Michael Beschloss, the presidential historian, wrote on social media.

Mr. Biden delivered the speech, his first focused on democracy since just before last year’s midterm elections, at an event meant to honor his old friend and adversary, Senator John McCain, one of the most vocal Republican critics of Mr. Trump before his death from brain cancer in 2018.

Appearing at the Tempe Center for the Arts in Mr. McCain’s home state, the president announced that he would direct federal money left over from the Covid-19 relief plan passed in early 2021 to help build a new library honoring the senator. The administration later said the federal contribution would be $83 million for an 83,000-square-foot facility near Papago Park.

In embracing Mr. McCain, Mr. Biden sought to reach out to anti-Trump Republicans and appeal to voters more generally in one of the battleground states likely to determine the outcome next year. Mr. Biden and Mr. McCain served in the Senate together for years and remained friendly even after running on opposing tickets in 2008, when Mr. McCain was the Republican presidential nominee and Mr. Biden was the Democratic vice-presidential nominee. Mr. Biden earlier this month visited a memorial to Mr. McCain in Hanoi, Vietnam.

Mr. McCain was one of the most vocal Republican critics of Mr. Trump, and Cindy McCain, the senator’s widow, endorsed Mr. Biden against the incumbent president of her party in 2020. In return, he appointed her ambassador to United Nations agencies for food and agriculture in Rome. Earlier this year, she was appointed executive director of the United Nations World Food Program.

Mrs. McCain introduced Mr. Biden in glowing terms, noting that while he and Mr. McCain were in the Senate together, they shared a deep commitment to country and civility even when they disagreed vigorously over policy. She choked up briefly when she recalled that Mr. Biden was the one who had introduced her to her late husband.

Kari Lake, the Trump ally who lost a race for governor of Arizona last year and now plans to run for Senate next year, fired back at the president even before his speech, arguing that the recent indictments of Mr. Trump constituted the real threat to the country.

“Joe Biden wants to talk about democracy in Arizona — meanwhile he is launching an unprecedented attack on our democracy, targeting his leading political opponent for the White House, attempting to put him in jail just months before the election,” she said in a statement.

The federal indictments against Mr. Trump, who is accused of trying to corruptly overturn the 2020 election and of mishandling classified documents, were secured by Jack Smith, a special counsel appointed by Attorney General Merrick B. Garland. There is no evidence that Mr. Biden has played any role in the cases, and Mr. Garland has firmly denied that politics were involved.

In his address, Mr. Biden cited inflammatory comments made by other Republicans, including Gov. Ron DeSantis of Florida, who talked of slitting the throats of civil servants, and members of Congress who have talked about destroying the F.B.I. and sought to whitewash the Jan. 6, 2021, attack on the Capitol.

“It’s not one person; it’s the controlling element of the House Republican Party,” he said. He noted that he heard few, if anyone, from the other side of the aisle speak out against Mr. Trump’s talk of treason and death. “The silence is deafening,” he said.

In a personal aside, he recalled Mr. Trump’s comments denigrating Mr. McCain’s military service (“He’s not a war hero. He was a war hero because he was captured.”) and reports that the former president has referred to soldiers who went to war as “suckers” and “losers.”

“Is John a sucker?” he asked of Mr. McCain. Mentioning his son Beau Biden, who served in Iraq and later died of brain cancer, he added, “Is he a sucker?”

Mr. Biden, who prides himself on passing some important legislation with bipartisan support, made a point of not painting every Republican with the brush of radicalism.

“Not every Republican — not even the majority of Republicans — adhere to the extremist MAGA extremist ideology,” he said. “I know because I’ve been able to work with Republicans my whole career. But there’s no question that today’s Republican Party is driven and intimidated by MAGA Republican extremists. Their extreme agenda, if carried out, would fundamentally alter the institutions of American democracy as we know it.”