WASHINGTON — It took seven years, but Charles Ulrich did something many people dream about, but few succeed at: He beat the IRS in a tax dispute.

Not only that, but tax experts say potentially millions of other taxpayers could benefit from his victory.

The accountant from Baxter, Minn., challenged the method the IRS has used for more than 20 years to tax shares and cash distributed by mutual life insurance firms to their policyholders when they reorganize as public companies.

A federal court recently agreed with his interpretation.

“There’s a tremendous amount of money at stake,” said Robert Willens, a New York City-based tax analyst at Robert Willens LLC.

“Tens of thousands of people could be in line for a refund.” Don Alexander, an IRS commissioner in the 1970s and now a tax attorney in Washington, said while it’s not unusual for individuals to take on the agency, “most of them lose.” Alexander called it “quite a significant case.” The dispute arose when more than 30 mutual life insurance companies became publicly traded corporations in the late 1990s and earlier this decade, in a process known as “demutualization.” Mutual companies are owned by their policyholders, so the companies provided stock and cash to compensate them for the loss of their ownership interests when they went public.

All told, roughly 30 million policyholders received distributions, Ulrich estimates. MetLife Inc. provided over $7 billion of stock to about 11 million policyholders when it went public in 2000, while Prudential distributed $12.5 billion in stock to another 11 million.

The IRS held that the recipients hadn’t paid anything for the shares and owed taxes on the full amount when the shares were sold.

Cash distributions also were fully taxable, the IRS said.

That didn’t sound right to Ulrich, 72, an accountant for 49 years. He began researching the issue in 2001, when he received shares from two companies, Prudential and Indianapolis Life.

Ulrich concluded that policyholders had paid for their ownership rights through their premiums so the distributions should have been tax-free.

That could make a significant difference in what a taxpayer owes. If a company distributed shares worth $30 and a recipient subsequently sold them at $32, under the IRS’ view they would pay taxes on all $32. Under Ulrich’s interpretation, they would owe taxes only on the $2 per share gain.

In 2003, Ulrich publicized his views by contacting tax and insurance experts and setting up a Web site.

“Largely I was regarded as a lunatic,” he said, who “would never prevail against the IRS.” Still, some people who’d paid taxes contacted Ulrich and asked him to file refund requests, which he did, for a fee. Some of those refunds were granted, he said. Tax experts say the IRS doesn’t always closely scrutinize small refunds.

One of his clients, Jean Prevost and her husband, Jim, who live near Minneapolis, received a refund of almost $1,500 in federal and state taxes in 2003.

“It wasn’t a huge amount of money, but it was ours,” she said.

But the IRS wasn’t pleased with Ulrich, accusing him of promoting abusive tax shelters and demanding the names of his clients, which he said he refused to provide.

The agency backed off in 2004 with help from the IRS’s Taxpayer Advocate office, Ulrich said.

IRS spokesman Bruce Friedland said the agency is prohibited from commenting on its interactions with taxpayers.

One of Ulrich’s clients, Eugene Fisher, a trustee for a Baltimore, Md.-based trust, sued the IRS in February 2004 after being denied a refund.

Judge Francis Allegra of the Court of Federal Claims in Washington sided with Fisher and called the IRS’ view “illogical” in an Aug. 6 decision. He ordered the agency to refund $5,725 in taxes plus interest to the trust overseen by Fisher.

It’s not clear how many people could benefit from the ruling.

Many of the 30 million policyholders are probably too late to seek refunds, since claims must be filed within three years of the April 15 tax deadline. That means the statute of limitations for taxes paid for 2004 ran out April 15, 2008.

Many individual taxpayers may not have enough at stake to go to the trouble, said Burgess Raby, a Tempe, Ariz.-based attorney who represented Fisher. Still, millions of policyholders could benefit from the court’s ruling, he said.

Raby credits Ulrich with being the driving force behind the issue.

“The genesis for this was Chuck’s real feeling that this was an unfair position” by the IRS, Raby said.

The government could appeal the ruling and likely will fight future refund claims, perhaps hoping for a different outcome in a separate court, tax experts said.

Charles Miller, a spokesman for the Justice Department, said the government hasn’t yet decided whether to appeal.

Still, taxpayers should request refunds if they’re eligible, the tax experts said, because even if the IRS rejects the claim, doing so extends the deadline for a potential refund for two more years.

Ulrich will prepare refund requests for interested taxpayers, for a fee, and has posted additional information at his Web site, www.demutualization.org. But he said the principle is more important to him.

“I think it’s important that taxpayers’ rights be protected,” he said. “We should have had a Boston Tea Party over this.”