SAN JOSE — A transient was hospitalized Sunday after he went to St. James Park near downtown armed with a handsaw, asked some people where he could buy drugs and then attacked their dogs with the saw, getting bit by a pit bull mix and then beaten by a group of men who saw what happened, police said.

According to police, a 25-year-old woman saw the 55-year-old man on the light rail line shortly before it pulled up to the station near the park, singing, dancing and displaying bizarre behavior.

When he arrived at the park shortly after 10 a.m., he approached three men and their two leashed dogs, one of them a female 5-year-old brindled pit bull mix named Chica, according to the dog’s previous owner.

“He asks them if they’re selling marijuana, but they blow him off,” said San Jose police Sgt. Jason Dwyer. “Then he hits one of the dogs with the saw, it yelps and the second dog jumps in and bites him.”

Dwyer said the first dog suffered a small cut to the nose, but when he struck the pit bull mix while she was attacking him, the saw left a 3-inch gash a quarter inch deep on top of her head.

The men pulled the man away from the dog, and he dropped the saw and fled toward the park playground. But he was intercepted by a second group of about five men who saw what happened and proceeded to punch and kick the man.

“His behavior was definitely bizarre,” Dwyer said. “Why would someone walk up to a group of people and just start hitting their dog with a saw?”

The group that beat the man left the park ahead of arriving officers, who found the suspected saw man suffering from a cut to the head and some bite wounds. He was taken to Regional Medical Center for treatment and the case was handed over to the Santa Clara District Attorney’s Office for review. His identity has not been released.

Dwyer said the dog was taken to an animal hospital with wounds not believed to be life-threatening, but he did not know its condition.

Huel Ewton, a San Jose resident who used to own Chica, said he talked to people at the emergency clinic who told him the dog needed stitches but was going to be OK.

He called her a good dog that needs to find a good home.

“There are a lot of people pulling for this dog, but no one has any money and the stitches are going to cost $600,” he said.

San Jose Animal Care and Services could not be reached Tuesday evening for an update on the status of Chica.

Contact Eric Kurhi at 408-920-5852. Follow him at Twitter.com/erickurhi.