PORTLAND, Maine — A Maine law that ties the amount of public funds candidates receive to how much their privately funded rivals spend is unconstitutional, a federal judge ruled Wednesday.

U.S. District Court Judge George Singal’s order declares the matching funds provision of Maine’s Clean Election Act invalid. He issued his decision based on last month’s U.S. Supreme Court decision striking down a similar public funding campaign finance provision in Arizona law.

Singal’s ruling stems from a lawsuit filed last August by state Rep. Andre Cushing claiming the matching funds provision violated his First Amendment rights. Cushing was not a Clean Election candidate and did not receive public funding in his 2008 and 2010 campaigns, but his opponents received extra public money based on how much he raised and spent. Cushing won both elections.

Portland attorney David Crocker, who represents Cushing, said lawmakers are going to have to revisit the law.

The ruling does not affect overall public funding of campaigns in Maine, but only the matching funds part of the law.

“It means that the Legislature is going to have to go back to the drawing board, but trying to resurrect matching funds is probably not possible because what the Supreme Court said was that any kind of supplemental funding scheme that is linked to nonparticipating candidates’ fundraising prowess or expenditures would be in violation of the First Amendment,” Crocker said.

Maine Attorney General William Schneider was out of town and could not immediately be reached for comment. But his office has agreed to comply with the ruling, according to Singal’s order.

Cushing, a Hampden Republican, claimed the matching funds part of the Clean Election Act violated his First Amendment rights because it had a chilling effect on how he conducted his campaigns. Whenever his campaign reached certain thresholds for fundraising, spending or even third-party spending on his behalf — over which he had no control — it would trigger matching funds for his opponents who were being funded with taxpayer dollars.

“The question to me was what right should politicians have to use taxpayer money and how far should the government intervene into the election process using government funds,” he said. “It left an unpalatable taste in a lot of people’s mouths.”

Maine’s matching funds provision has been challenged in years past and upheld in federal District Court and the 1st Circuit Court of Appeals in Boston, Crocker said.

But in the Arizona case, the Supreme Court ruled 5-4 that the “trigger mechanism” in the Arizona law — similar to the trigger mechanism in Maine law — violated the First Amendment. Supreme Court justices left in place the rest of Arizona’s public financing system.