PORTLAND — The state’s highest court Thursday dismissed Ralph Nader’s lawsuit against Democrats he accused of trying to keep him off ballots in Maine and other states during his failed presidential run in 2004.

In a unanimous decision, the Maine Supreme Judicial Court affirmed a judge’s dismissal of several counts and ordered that the remaining counts of Nader’s lawsuit against the Maine Democratic Party be dismissed.

Nader, the consumer advocate who ran in 2004 as an independent, claimed that the Democratic Party and its allies orchestrated a nationwide effort against him using illegal and malicious tactics.

Many Democrats blame Nader for siphoning away votes in an election won by Republican George W. Bush.

Nader’s attorney, Oliver Hall, said Thursday that he will have to review his options before deciding whether to ask the court to reconsider or appeal to the U.S. Supreme Court.

The lawsuit has been winding through the courts since 2009, when Nader chose to sue in Maine after the statute of limitations expired on his lawsuit in the Court of Appeals for the District of Columbia.

Nader contended the Democrats filed 29 complaints in 18 states and Washington, D.C., often accusing the Nader campaign of fraud without any evidence or citing innocent, small technical mistakes on petitions.

The Democratic Party said it had a constitutional right to challenge Nader’s efforts to get on the ballot.

Nader and his 2004 running mate, the late Peter Camejo, ultimately appeared on the ballot as independents in 34 states, including Maine, and collected only three-tenths of 1 percent of the nation’s popular vote.