A 17-year-old skateboarder who was attacked at a Hollywood gas station and then fought back was able to get the charge against him dismissed because of Florida’s “Stand Your Ground” law, authorities said.

The Broward County public defender’s office says the cameras at a Hess station on Federal Highway in Hollywood turned out to be the teen’s best friend.

Prosecutors said a man, shown on the left in the surveillance video, was the victim in the Feb. 23 incident. He made a gesture and said something to the skateboarder. A confrontation and fight ensued.

“The first swing is by the alleged victim. That’s the first physical aggression,” said Melinda Blostein, the public defender who represented the skateboarder.

Then the man’s brother left the gas station store and joined in, landing at least 10 punches to the boy’s head, authorities said. Even when he got away, they chased him down, said Gordon Weekes, the Broward assistant chief public defender.

“I think he had a legitimate, reasonable fear that if he didn’t do something, if he didn’t continue to fight, he could have been seriously injured or he could have died,” Blostein said.

As the video shows, the teenager then got back in the fight and stabbed the alleged victim before he finally escaped for good.

On Tuesday Judge Elijah Williams watched the video and granted Blostein’s motion to dismiss the case based on the “Stand Your Ground” law.

Blostein said she and the 17-year-old, who had faced a charge of aggravated battery, are both relieved.

“In this case, thank gosh there was a video, because this kid would have been in prison,” she said.

“This kid was very lucky to have this video, and very lucky to have Stand Your Ground,” Weekes said.