Maine on Thursday became the second state to bar Donald J. Trump from its primary election ballot after its top election official ruled that the former president’s efforts to remain in power after the 2020 election rendered him ineligible to hold office again.

Hours later, her counterpart in California announced that Mr. Trump would remain on the ballot in the nation’s most populous state, where election officials have limited power to remove candidates.

The official in Maine, Secretary of State Shenna Bellows, wrote in her decision that Mr. Trump did not qualify for the ballot because of his role in the Jan. 6 attack on the Capitol. A handful of citizens had challenged his eligibility by claiming that he had incited an insurrection and was thus barred from seeking the presidency again under the 14th Amendment of the Constitution.

“I am mindful that no secretary of state has ever deprived a presidential candidate of ballot access based on Section 3 of the 14th Amendment. I am also mindful, however, that no presidential candidate has ever before engaged in insurrection,” Ms. Bellows, a Democrat, wrote.

Ms. Bellows’s decision follows a Colorado Supreme Court ruling last week to keep Mr. Trump off the state’s Republican primary ballot.

The decisions in Maine and Colorado underscore national tensions over democracy, ballot access and the rule of law. They also add urgency to calls for the United States Supreme Court to insert itself into the politically explosive dispute over Mr. Trump’s eligibility.

Steven Cheung, a spokesman for the Trump campaign, said Thursday night that both the Maine and Colorado rulings were “partisan election interference efforts” that were “a hostile assault on American democracy.”

Just weeks before the first votes in the 2024 election are set to be cast, lawyers on both sides are asking the nation’s top court to provide guidance on an obscure clause of a constitutional amendment enacted after the Civil War, which is at the heart of the effort to block Mr. Trump from making a third White House run.

Courts in two other states, Minnesota and Michigan, have ruled that election officials cannot prevent the Republican Party from including Mr. Trump on their primary ballots.

Michigan’s Supreme Court concluded on Wednesday that an appeals court had properly decided that political parties should be able to determine which candidates are eligible to run for president.

Another court decision is expected in Oregon, where the same group that filed the Michigan lawsuit is also seeking to have the courts remove Mr. Trump from the ballot there, though Oregon’s secretary of state declined to remove him in response to an earlier challenge.

In California, Secretary of State Shirley Weber, a Democrat, had faced a Thursday deadline to certify the list of official candidates so that local election officials could begin preparing ballots for the upcoming election.

She had indicated in recent days that she was inclined to keep Mr. Trump on the ballot based on her interpretation of California law, despite a late request from the lieutenant governor to explore ways to remove him.

The legal cases are based on a Reconstruction Era constitutional amendment that was intended to bar Confederate officials from serving in the U.S. government. The provision, Section 3 of the 14th Amendment, disqualifies people who “engaged in insurrection or rebellion” from holding office.

Over the years, the courts and Congress have done little to clarify how that criterion should apply. As the legal challenges mount, election officials and judges across the country find themselves in largely uncharted waters as they wait for the Supreme Court to provide guidance.

The case would be the most politically momentous matter before the Supreme Court since it settled the disputed 2000 election in favor of President George W. Bush. Since then, the court has become far more conservative, in large part as a result of the three justices whom Mr. Trump appointed as president.

Mr. Trump and his lawyers have called the efforts to bar him from ballots an underhanded tactic by Democrats who fear facing him at the polls.

Groups leading the disqualification efforts contend that the former president’s attempts to subvert the will of voters in 2020 warrant extraordinary measures to protect American democracy.

Ms. Bellows, the official in Maine charged with considering the petition in that state, is the state’s first female secretary of state and a former state senator. She is also the former executive director of the nonprofit Holocaust and Human Rights Center of Maine and of the American Civil Liberties Union of Maine.

In her 34-page decision, Ms. Bellows wrote that Mr. Trump’s petition to appear on the Maine ballot was invalid because he falsely declared on his candidate consent form that he was qualified to hold the office of president. She found that he was not, she wrote, because “the record establishes that Mr. Trump, over the course of several months and culminating on Jan. 6, 2021, used a false narrative of election fraud to inflame his supporters and direct them” to prevent the peaceful transfer of power.

She also concluded that Mr. Trump “was aware of the likelihood for violence and at least initially supported its use given he both encouraged it with incendiary rhetoric and took no timely action to stop it.”

Legal experts say the scope of a Supreme Court decision on the issue would determine if these challenges will be quickly handled or play out for months.

A ruling that Mr. Trump’s conduct cannot be construed as a violation of the 14th Amendment would effectively shut down challenges pending in several states. A narrower ruling on the Colorado case could allow Mr. Trump to remain on the state’s primary ballot, while giving lawyers challenging his eligibility a chance to argue that he should be kept off the general election ballot.

The petitioners in Maine included Ethan Strimling, a former mayor of Portland and Democratic state legislator who filed a challenge along with two other former Maine lawmakers.

“Secretary Bellows showed great courage in her ruling, and we look forward to helping her defend her judicious and correct decision in court,” they said in a statement on Thursday. “No elected official is above the law or our constitution, and today’s ruling reaffirms this most important of American principles.”

Mr. Trump can appeal Ms. Bellows’s decision to Maine’s Superior Court within five days. Her order will not go into effect until the court rules on an appeal, which the Trump campaign says it intends to file soon. The Republican primaries in Maine and Colorado are both scheduled for March 5, known as Super Tuesday because so many states hold primaries that day.

The challenges to Mr. Trump’s ballot access have been brought in more than 30 states in recent weeks, largely through the courts. But because of a quirk in Maine’s Constitution, registered voters there must first file a petition with the secretary of state.

Ms. Bellows heard arguments on three such petitions on Dec. 15.

After the Colorado decision, lawyers for Mr. Trump argued in new Maine filings that the Colorado ruling should be irrelevant there because the two states had different laws and standards, and because Mr. Trump did not have a fair opportunity to litigate the facts in Colorado. They also maintained that the secretary of state lacked the authority to exclude him from the ballot.

“The constitution reserves exclusively to the Electoral College and Congress the power to determine whether a person may serve as president,” they argued in the filing late last week.

Richard L. Hasen, a law professor at the University of California, Los Angeles, and an election law expert, said the Maine decision illustrated the power of the Colorado court ruling to ease the way for similar decisions.

“It takes a lot of courage to disqualify a major candidate, but once the Colorado court did it, and thrust the issue into public light, it became easier for others,” he said.

Given the “incredible complexity” of the legal questions involved, said Mr. Hasen, the U.S. Supreme Court is best equipped to resolve the issues. If the court opts not to disqualify Mr. Trump, its decision would not be binding for Congress, but it would make it “politically very difficult for Congress to say something different,” he said.

In California, Democrats have overwhelming control of government, so the state might have seemed a likely venue for a ballot challenge similar to the one that was successful in Colorado.

But legal experts said that California, unlike many other states, does not explicitly give its secretary of state the authority to disqualify presidential candidates.

Nonetheless, Lt. Gov. Eleni Kounalakis, a Democrat, asked Ms. Weber last week to “explore every legal option” to remove Mr. Trump from the ballot using the same constitutional justification cited by the Colorado Supreme Court.

In response, Ms. Weber suggested last week that she planned to leave the question up to state and federal courts, which have already dismissed at least two lawsuits in the state challenging Mr. Trump’s qualifications. Ms. Weber wrote that she was obligated to address ballot eligibility questions “within legal parameters” and “in a way that transcends political divisions.”

Gov. Gavin Newsom of California indicated last week that he did not believe officials in his state should remove Mr. Trump from the ballot. “There is no doubt that Donald Trump is a threat to our liberties and even to our democracy, but in California we defeat candidates we don’t like at the polls,” he said in a statement. “Everything else is a political distraction.”

Nicholas Bogel-Burroughs contributed reporting.