SAN QUENTIN, Calif. (AP) _ Hard time calls for hard rock _ at least that's the view of Metallica, who performed a free hourlong concert at San Quentin State Prison.

The heavy metal band, which is based just up the road in Marin County, agreed to perform Thursday for about 800 inmates after spending 18 hours at the prison Wednesday filming the video for the title track to its new album, ``St. Anger.''

A spokesman for Metallica's record company, Elektra Records, said prisoners and guards appeared as extras in the video, which was shot inside a cell block and in the outside yard during a lunch break.

``It was a humbling day for everyone,'' Joel Amsterdam said. ``The song talks about the good and bad ways to release anger, and what that can do to you if you don't do it correctly. So it's sort of the perfect song to play for the inmates.''

Other musicians who've played at San Quentin include Bonnie Raitt and Carlos Santana.