President-elect Joseph R. Biden Jr. has narrowly won Arizona, capturing the state’s 11 electoral votes and strengthening his Electoral College margin as President Trump continues to make baseless attacks on the vote counts favoring Mr. Biden.Mr. Biden, whose margin in Arizona is currently about 11,000 votes, or 0.3 percentage points, is the first Democratic presidential candidate to carry the state since President Bill Clinton in 1996. Four years ago, Mr. Trump won the state by 3.5 percentage points.

That Arizona — the home of the late Senator John McCain and Senator Barry Goldwater, a founder of the 20th century conservative political movement and the 1964 Republican presidential nominee — was in play for Democrats at all is remarkable. Before the state voted for Mr. Clinton, the last Democrat it had supported for president was Harry S. Truman in 1948.

Mr. Biden’s win underscored a profound political shift in Arizona, a longtime Republican bastion that has lurched left in recent years, fueled by rapidly evolving demographics and a growing contingent of young Hispanic voters championing liberal policies.

Last week, the Democratic challenger Mark Kelly defeated the state’s Republican senator, Martha McSally, in a special election making Mr. Kelly and Senator Kyrsten Sinema the first pair of Democrats to represent Arizona in the Senate since the 1950s.

The Arizona victory brings Mr. Biden to 290 electoral votes 20 more than the 270 required to take the White House.

Republicans have been mounting long-shot legal attempts to try to upend results in key battleground states, but they have mostly been dealt setbacks — and some of their cases deal with small numbers of ballots.

For instance, Mr. Trump would have to invalidate about 55,ooo Pennsylvania votes to overturn Mr. Biden’s victory there. The office of Pennsylvania’s attorney general, Josh Shapiro, has said that there is no evidence to support claims from Mr. Trump’s lawyers that the election in Philadelphia or elsewhere in Pennsylvania was fraudulent.

The Trump campaign has filed a lawsuit in Arizona alleging that poll workers in the state’s largest county, Maricopa, improperly pressured voters to enter their vote in a way that would incorrectly reject votes.

On Wednesday, Arizona’s attorney general, Mark Brnovich, a Republican, told Fox News that state officials had received about 1,000 complaints about the election but had found “no evidence” of widespread voter fraud.

“If indeed there was some great conspiracy, it apparently didn’t work,” he said.