Heavy metal band Metallica recorded the official video for its latest album, set to drop in November, at the San Rafael High School gym.

Not only did the group record the video for “Hardwired … to Self-Destruct,” scheduled to be released Nov. 18, at the gym in August, Metallica also released a “making of” video memorializing the event, and the gym.

“It’s pretty cool. They do have some local ties here,” said Christina Perrino, spokeswoman for the San Rafael City Schools District.

James Hetfield, co-founder of the band, lives in Marin and the band has a recording studio in the county.

The school district regularly rents out its gyms, both as a way to provide venues for community groups and as a source of revenue. Of course, the groups that rent the gym are usually a bit more sedate. Community groups such as San Rafael Little League, Swimarin, San Rafael Youth Soccer and the North Bay Basketball Academy are examples of others who rock out, in their own way, at the district’s high school gyms.

Metallica paid $2,590 for the day on Aug. 16, during school vacation, Perrino said.

“They paid our commercial rates,” she said. “We respected their privacy and let them do their business. We didn’t publicize it.”

Word eventually got out, probably because the “making of” video prominently features a shot of the high school gym at the beginning, then cuts to a shot of a basketball hoop.

Next, a worker says, “We have some speakers set up for you that I’m going to blast for you and see if it’s going to be OK, if we need to get some of yours.” The speaker blasts and Lars Ulrich, the drummer and one of the founding members of the band, jokingly runs from the sound, saying, “It’s fine. I think there was somebody complaining about noise in San Francisco?”

Perrino said, “There are many, many Metallica fans in the San Rafael City Schools community, and it’s been fun to see the excitement as a result of the filming. We’re grateful they chose to support our schools.”