Above: August 19, 1984 – San Francisco, California, United States: Runners in Golden Gate Park, with the Conservatory of Flowers in the background, during The San Francisco Marathon. (Steve Ringman / San Francisco Chronicle / Polaris)

Contributed by Erin Mara, a writer and runner living in San Francisco.

The San Francisco Marathon — in its 40th year — is a race around the perimeter of San Francisco, past iconic landmarks, by historic neighborhoods, through Golden Gate Park and over the Golden Gate Bridge. It’s a 26.2 mile loop where nearly 30,000 runners compete in the impossibly scenic USATF certified course, which is also a Boston Marathon Qualifier and an Olympic Team Time Trials Qualifier race.

What has become a monumental and extraordinary race is rooted in the ambitions of a passionate and authentic local running community.

SF Marathon

July 11, 1982 – San Francisco, California, United States: Runners on California Street during The San Francisco Marathon. (Steve Ringman / San Francisco Chronicle)

The idea for The San Francisco Marathon started in the late 1970s — at the height of the first running boom — by a running group called the Pamakids Runners Club. Their name represented their inclusionary bunch of men, women, and children, thus named after “Pa,” “Ma” and the “kids.”

Club members at the time recall the club’s impetus for service. “We wanted to put something back into the sport of running,” said former Pamakids president John Medinger. “We thought, if we were going to get something out of it, we wanted to put something back in. We wanted to be contributing to the sport.”

Scott Thomason, a Pamakids member and the first director of The San Francisco Marathon, said the group’s goal was to create a running event that people in the running community would want to participate in. “This was a race for runners, by runners,” he said.

As running was growing in popularity, runners were eager to get a marathon under their belt. “There was nothing like this at the time,” Thomason said. “The novelty of running a marathon in San Francisco was just exciting.”

The Pamakids were headquartered in the Sunset District, and they often ran in that western end of the city — all through Golden Gate Park and around Lake Merced. So it only made sense that their first major organized race would be in their bailiwick.

On clear and sunny July 10, 1977, nearly 1,000 people from the local running community laced up their sneakers at the starting line in Golden Gate Park. Race entry was $5 (about the cost of a record at the time), and race numbers were made of cardboard, recalled long-time Pamakid Runner Tony Rossmann in a 20-year recap he wrote of the race. Since 1977, Rossman has run The San Francisco Marathon more than 30 times. He told the San Francisco Chronicle that the current race is “probably the most beautiful urban course you can imagine. It’s a challenging course, but it’s a terrific race to just see San Francisco at its best.”

In the race’s first year, the course was much different than it is now. “It was brutal,” said Mike Fanelli, an accomplished and prolific Bay Area runner who was part of the original organizing committee and was later responsible for recruiting top talent.

The course began in Golden Gate Park and did three loops inside the green expanse. “In Golden Gate Park, you’re either going up or down; there was lots of pounding,” Fanelli said. It then took runners out to the Great Highway, the city’s western edge along the Pacific coast. “We ran into the wind on Great Highway, out in the middle of nowhere,” he said. From there, the race looped around Lake Merced, a freshwater lake in the southwest corner of the city. The course headed back to the Great Highway, then finished along JFK Drive at the Polo Fields, in the center of Golden Gate Park. “Finishing up on JFK — that’s a big hill, and the the last thing you want to see at the end of a race,” Fanelli said.

Despite the challenges, Fanelli said the race was “an instant hit.” It became a destination for people from all over, he said, citing the novelty of running a race in the summer, when it’s usually too hot to compete.

“This was early on in the big-city marathon experience, and it was a big deal to get to run a race in the summertime, thanks to San Francisco’s cool summer climate,” Fanelli said. “Plus, it became an excuse to visit the city — everyone wanted the San Francisco experience, Rice-A-Roni and all that.”

Because of the success of the 1977 inaugural San Francisco Marathon, the race tripled in size the following year. Race organizers were onto something big, and city runners were becoming part of what would be one of the top destination races in the country.