A U.S. federal appeals court in San Francisco has ruled that police can't zap someone with an electronic stun gun unless the suspect poses an immediate threat.

Monday's ruling sets police standards for use of the Taser, saying stun guns must be used only when "substantial force" is needed.

The Ninth U.S. Circuit Court of Appeals said officers can't Taser a person simply for acting erratically or disobeying orders. They must take into account factors including whether the person was trying to flee and the severity of the charges that might stem from the offence, Judge Kim Wardlaw said, given the "painful and frightening blow" inflicted by the electronic devices.

The ruling allows a San Diego-area man to proceed to trial in a lawsuit against police in the San Diego County town of Coronado.

Carl Bryan said he was shocked, fell and lost four teeth in the incident. He acknowledges that he was acting erratically but says he was unarmed, stood far away and never menaced the officer.

Bryan, then 21, was wearing only boxer shorts and running shoes when police stopped him and prepared to ticket him for not wearing his seatbelt. Upset at having received a speeding ticket a short time earlier, he began swearing and got out of the car, taking what he claims was "one step" toward the officer ticketing him before that officer used his Taser.