The race begins on the west side of San Quentin’s lower yard, just before the sun creeps over the walls. Two dozen men surge forward. With few exceptions all are murderers, most at least a decade into their sentences, including the early leader, a lifer named Markelle Taylor, who has run this course before but never for as long or as fast as he hopes to today.

With mesh gym shorts hanging to his knees and a cotton tank that soon droops with sweat, Taylor springs over a patchwork of gravel and pavement and grass scorched by the California drought. He makes his first turn at the laundry room, where inmates in V-neck smocks and denim jackets exchange their prison blues, then jabs right at the horseshoe pit and climbs a tight concrete ramp—a pivot so abrupt it has a name: the Gantlet. He swings east across blacktop, past the open-air urinals, past the punching bag and chin-up bars, past the clinic that treats the swell of aging convicts, all while staying within the spray-painted green lines that are supposed to remind the 3,700 non-runners housed here not to wander into his path. On the north side, Taylor guides the pack downhill toward the base of a guard tower, then makes a final 90-degree turn—his sixth—where convict preachers thump Bibles in a cloud of geese and gulls.

That’s one lap. Today there’s a marathon. Behind these walls, that means 104 to go.

Once a year, the runners of San Quentin do this—stretch their tatted limbs, hike their white crew socks, and attempt to extract under the worst of conditions something that resembles the best of themselves.

“You’re seeing people escape from prison,” says Rahsaan Thomas, sports editor of the inmate-produced San Quentin News, who is 12 years into a 55-to-life sentence for shooting two armed men. “Here,” says Thomas, who is helping pass out water, “you can only be free in your own mind.”

If running a marathon is as much a test of mental rigor as of physical endurance, then doing 26.2 miles at California’s oldest prison, home to America’s largest death row, is the ultimate internal contest. On the outside, marathons are movable celebrations that engulf and delight entire cities. The Los Angeles Marathon follows a glittery path from Dodger Stadium, via the Sunset Strip and Rodeo Drive, to Santa Monica Beach; the New York Marathon traverses a five-borough jamboree to the cheers of a million spectators. In the lower yard, a four-acre box on San Quentin’s sloped backside, the only way to re-create that distance is to run the perimeter—round and round, hour after hour—going nowhere fast.

Sometimes even that exercise in confinement will grind to a halt. No matter the day, alarms punctuate life at San Quentin, signaling fights or medical emergencies, often in corners of the prison unseen from the lower yard. In those moments, every inmate must drop to the ground—runners included—and wait for guards to restore order. During last year’s race, the marathoners had to stop four times.

Twenty-five inmates will start the race, but only seven will finish.

Perched on the redwooded fringes of San Francisco Bay, about 12 miles north of the Golden Gate Bridge, San Quentin is an anachronism: a moldering castle that dates from the Gold Rush days, now commandeering 432 acres of waterfront property in California’s richest county.

Charles Manson and Sirhan Sirhan have passed through these iron latticed gates. Johnny Cash has performed here, earning a Grammy nomination and inspiring a young burglar named Merle Haggard. So many bebop greats did time for heroin that San Quentin used to field its own jazz band. Crips leader and Nobel Peace Prize nominee Stanley Tookie Williams (played by Jamie Foxx in Redemption) was executed here. Wife slayer and cable-news obsession Scott Peterson (played by Dean Cain in The Perfect Husband) awaits his turn. So do 725 other men, their fate likelier to be decided by old age, or their own hand, than by the state’s glacial appellate machinery.

Despite its notorious name and medieval atmospherics, the Q is known within the American penal system as a rehabilitative showcase, the place to be if you want to do something productive with your time—and not, as the old heads will say, let your time do you. The prison hosts at least 140 programs, from Wall Street investing to Shakespearean theater, sustained by thousands of volunteers from the Bay Area’s prosperous burbs. Which is how Frank Ruona, then the president of an elite Marin County running club, ended up receiving a call in 2005 from a prison administrator seeking a coach. Ruona—a veteran of 78 marathons who was also an executive at Ghilotti Bros., a ubiquitous highway contractor—didn’t see himself ministering to felons, but when he forwarded the request to his hundreds of fellow Tamalpa Runners, he got no response. “So, I said, ‘Yeah, I’ll come over,’ ” Ruona recalls. “I wasn’t sure what to expect.”

The 163-year-old prison, for all its educational offerings, was a cold, clamorous tangle of concrete cellblocks, five stories tall and ringed by razor wire—“an environment that’s very degrading, very demoralizing,” Ruona had to admit—and yet he discovered that it had also bred a small brotherhood of would-be runners “trying their best to pay for whatever errors they’ve made.”