Seattle City Council President Tim Burgess, who sponsored the city's ordinance establishing the tax of $25 per gun and 2 or 5 cents per round of ammunition, commented after the decision.
"Then NRA and its allies always oppose these common-sense steps to shine light on the gun-violence epidemic," Burgess said.
The NRA vowed to appeal.
"It's unfortunate the court chose to ignore the law and embrace the Seattle City Council's anti-gun agenda," spokesman Lars Dalseide said in a statement.
Burgess has said Seattle's tax is expected to raise thousands of dollars annually. Critics of the ordinance have questioned that, saying the tax won't raise much at all if it drives the city's few remaining gun stores out of town.