SAN FRANCISCO - The federal government has found a new weapon in its war on marijuana - the tax man.

A San Francisco Bay area medical marijuana dispensary that promotes itself as the world's largest has been hit with a $2.4 million tax bill following an audit by the Internal Revenue Service, the dispensary founder said Tuesday.

The back taxes, penalties and interest levied against Harborside Health Center came after the IRS examined its returns for 2007 and 2008 and determined a 1982 tax code prohibiting cost deductions for businesses that traffic in illegal drugs applies to the dispensary.

Harborside is a spa-like fixture on Oakland's waterfront with 94,114 registered customers and 84 full-time employees that offers an average of 30 varieties of medical marijuana every day and has $22 million in annual sales.

"What kind of drug trafficking organization actually files a tax return? None of them do," said Harborside CEO Steve DeAngelo, who gave his auditor a personal tour of his posh apothecary. "The very fact that we filed a tax return and told the IRS all the details of what we are doing proves we are not a drug trafficking organization."

The IRS said the agency does not comment on individual audits.

DeAngelo, the subject of an upcoming Discovery Channel reality show, said the write-offs disallowed by the IRS included standard operating costs such as rent, payroll, employee health insurance and licensing fees.

Government auditors did not dispute, however, that Harborside had properly deducted its biggest expense - the millions of dollars it spent buying pot to sell to people who use it under California's medical marijuana law.

San Francisco tax attorney Henry Wykowski, who represents DeAngelo, said a 2007 case involving another California dispensary established that the cost of goods sold was a legitimate expense for businesses the IRS otherwise considers illegitimate.

"It goes all the way back to Prohibition," Wykowski explained. "They expect even businesses operating illegally to file tax returns, so they still have to give them their business deductions, and a cost of goods sold is the primary deduction that any business would have."

DeAngelo has until Dec. 22 to contest the audit in tax court. The IRS has told him it is now reviewing Harborside's returns for 2009 and 2010.

Meanwhile, a handful of state officials have written House Speaker John Boehner, a Republican, and Senate Majority Leader Harry Reid, a Democrat, on behalf of DeAngelo, asking the two lawmakers to exempt "legally operating cannabis businesses" from the tax code section for drug traffickers.

DeAngelo said he does not have the $2.4 million the IRS wants. Like all legal medical marijuana dispensaries in California, Harborside operates as a nonprofit corporation while paying state sales taxes and a 5 percent local tax to Oakland - for a total of $3.1 million this year, he said.

"We would be happy to pay taxes like every other business does," he said. "No business, including Harborside, could survive if it's taxed on its gross revenue. All we want is to be treated like every other business in America."

Wykowski said he represents at least two dozen other California and Colorado pot dispensaries dealing with IRS audits. Some have persuaded auditors to accept deductions for auxiliary services such as on-site yoga classes, the time employees spend counseling customers as opposed to preparing marijuana, and quality testing. Others such as Harborside have been less successful.

"What the taxing authorities are losing sight of is if you tax these places out of business and make it so they can't compete, all it is going to do is boost underground sales," he said. "The guys on the street aren't paying their employees and if they are, they certainly aren't withholding taxes."