A park ranger used a stun gun on a man she stopped for walking his two dogs without a leash in northern California.

The man was stopped by the ranger Sunday afternoon at Rancho Corral de Tierra, part of the Golden Gate National Recreation Area, near Montara, south of San Francisco.

Park Service spokesman Howard Levitt told the San Francisco Chronicle the ranger was attempting to educate the man about keeping dogs on a leash when he provided her with a false name.

After being asked to remain at the scene the man, later identified as Gary Hesterberg, proceeded to walk away.

The ranger "pursued him a little bit and she did deploy her" electric-shock weapon, Levitt said. "That did stop him."

After being treated by paramedics, Hesterberg was arrested on suspicion of failing to obey a lawful order, having dogs off-leash and knowingly providing false information.

Witnesses said they thought using a stun gun on a man who was walking two small dogs of a leash seemed excessive.

"It was really scary," said Michelle Babcock, who was walking her two Border Collies with her husband at the time.

Babcock said she heard the man ask several times why he was being detained.

"I just felt so bad for him. He just tried to walk away. She never gave him a reason," she said.

"We were like in disbelief. It didn't make any sense."