A judge declared a mistrial Tuesday in the case against a popular skateboarder accused of smashing a San Francisco security guard in the head with a skateboard last year, fracturing the man’s skull and causing a severe brain injury.

The jury deadlocked six-six with members of the panel unable to decide whether to convict or acquit 24-year-old Jesse Vieira of assault with a deadly weapon, assault with force likely to commit great bodily injury and battery with serious bodily injury in the Nov. 25 run-in that left Dan Jansen, 57, permanently brain damaged.

The district attorney’s office must now decide whether it will refile or dismiss the charges against Vieira. “We are currently evaluating how best to proceed,” said Alex Bastian, a spokesman for the office.

The jury of three women and nine men came back deadlocked after beginning deliberations at the end of the two-week trial. The members of the panel voted five times amid their discussions, the last three of which they split six-to-six on whether to convict, the foreman told Judge Braden Woods, who declared the jury “hopelessly deadlocked.”

“I think anytime the prosecution presents their best case and can’t get a conviction it’s clearly a win for the defense,” Vieira’s attorney, Doug Rappaport, said outside court after thanking the jurors and shaking each of their hands.

Rappaport had argued his client was defending himself when Jansen charged him amid the fracas that broke out on the plaza at 555 California Street. Vieira and six other men had been skateboarding, some moving the metal barriers at the plaza, before things escalated and ended with Jansen striking the back of his head on the hard granite paving.

Much of the episode was captured on video from cameras around the plaza along with footage shot by one of the skateboarders in the group.

Vieira is a well-know Bay Area skateboarder. He was featured on the August cover of Thrasher magazine and is a member of the GX1000 crew known for daredevil hill bombs.

After Jansen was knocked unconscious, the pack of skateboarders fled, leaving him in a pool of his own urine. Doctors put him into a medically induced coma to deal with a spiderweb-type fracture in the back of his skull and bleeding in the brain.

Surgeons removed part of his frontal lobe and skull during surgery. He can’t walk but is beginning to recognize some family members who visit him at an assisted living facility where he has live-in care.

Jansen — a former soldier in the Army and avid fisherman — faces a long road ahead. It’s not clear if he will be able to care for himself ever again, his family said.

Evan Sernoffsky is a San Francisco Chronicle staff writer. Email: esernoffsky@sfchronicle.com Twitter: @EvanSernoffsky