The last thing Robert Yuen said to Calvin Fong was, “It’s going to be OK.”

The two teenagers and their friend Donald Kwan lay among a mess of smashed dishes, ice water and hot soup on the floor of San Francisco’s Golden Dragon restaurant, all bleeding from gunshot wounds, casualties in one of the city’s most horrific crimes.

As it turned out, Fong and Kwan were not OK. They were two of the five people killed early in the morning of Sept. 4, 1977, in an atrocity that altered the lives of everyone in that Chinatown restaurant — as well as Chinatown itself.

It was the culmination of years of gang violence that had killed dozens of people in a neighborhood that was both a tourist attraction and home to thousands of low-income immigrants. Most of the gang wars’ casualties had been combatants gunned down in the streets. This time the battleground was a well-known restaurant, and most of the people there had no idea who was doing the shooting or why.

In the aftermath of what at the time was San Francisco’s worst-ever mass shooting, the Police Department, community leaders and city officials would undertake changes that tamped down the gang wars and made Chinatown safer.

But that would take years. At 2:40 that morning in the Golden Dragon on Washington Street, Fong was dying of a gunshot to the abdomen. Kwan was already gone — he had been shot in the head.

Two other diners and a waiter also died, and 11 people were wounded when men with stockings masking their faces — members of a Chinatown gang known as the Joe Boys — unleashed a torrent of gunfire that missed their gang enemies, including a recently immigrated gangster named Raymond “Shrimp Boy” Chow.

Yuen, shot in the abdomen, still has the scar. He’s 59 years old and says the “jarring images” of the attack that ended his friends’ lives no longer flash in his head. The passage of time, years of reflection and self-medication have taken care of that.

“It was one of those life-interrupted things,” Yuen said in his first interview since the massacre. “You wonder if things could have been better if it didn’t happen. I was pretty bitter for a long time.”

The attack was supposed to be payback. A Joe Boy had been killed in a running gunbattle after the gang was ambushed by its rival, the Wah Ching, on the Fourth of July at Chinatown’s Ping Yuen housing project.

Two months later, the Joe Boys sought to strike back after getting a call from a lookout, who had spotted members of the Wah Ching and another rival gang, the Hop Sing Boys, at the Golden Dragon.

Now Playing:

Retribution killings were common in the Chinatown of the 1970s. Nearly 40 people had been slain in gang violence already that decade. Many who joined the fighting represented factions that often were divided between those born in America and a recent influx from China.

“Chinatown was scary,” said retired police Sgt. Daniel Foley, who helped solve the Golden Dragon case. “You never knew what was going to happen.”

But the mass killing of innocents in a restaurant filled with more than 75 diners had a different resonance. Mayor George Moscone offered an unprecedented $100,000 reward and the Police Department organized a gang task force, which has operated ever since.

“Initially it was overwhelming,” said Foley, who worked the Chinatown gangs for 24 years. “You’re trying to interview victims and find witnesses. You have this massacre. It was just panic.”

Facing public pressure and few tips from the community, the task force of fewer than a dozen cops fanned out at schools, worked nights and interviewed everyone in sight, developing files on scores of suspected gang members.

The effort paid off. Two weeks after the shooting, police got a lead from a hard-core Joe Boy named Gai Wah Woo, who had been arrested for extortion and was looking to collect the reward. He led investigators to one of the shooters, a student at Galileo High, who eventually unspooled the entire plot in a recorded interrogation.

Within seven months of the shootings, police had arrested the three shooters, a getaway driver, the attack’s mastermind and several accomplices.

“No one expected the case to be solved — no one but us,” Foley said.

As police sought to intervene in the violence, so did Chinatown, where residents and merchants wanted not only to be safe but also to create an inviting atmosphere for tourists and special events.

Some community organizers focused on getting neighborhood youths to channel their energy away from crime, while others sought to work directly with the gangs, mediating disputes before they were settled in the streets.

“Chinatown has gone through a lot of change in the last 40 years,” said Mabel Teng, a Hong Kong native who came to the neighborhood in the late 1970s, became an activist and went on to be elected to the city’s Board of Supervisors twice in the 1990s.

“There was a generational gap,” she said. “Young people were growing up alienated. The huge gap between the haves and the have-nots was very big in Chinatown, and that’s the reason a lot of our young people fell into gang activity.”

Today, she said, “Chinatown is as strong and vibrant because so many of us believe in it.”

In the aftermath of the killing, bustling Grant Avenue fell silent and business plummeted at restaurants — a pall that eventually lifted amid the intensified effort to snuff out the gangs.

Four decades later, the brutality of the Golden Dragon massacre remains stark. The killers intended to strike a blow in an insular gang war, but killed only bystanders, mostly young people with ambitious plans to help their Asian American communities. Friends of the slain victims still think about what was lost in their deaths.

There was 25-year-old city native Paul Wada, a social activist and law school student at the University of San Francisco who had co-founded what later would become Asian Pacific Islander Legal Outreach, serving marginalized groups around the Bay Area.

“Paul is one of the unsung heroes of San Francisco Asian American history,” said Esther Leong, 59, who was once mentored by Wada in a program called Upward Bound and now serves as administrative director of the outreach group he co-founded.

She recalled that many of the young people Wada helped were the first in their families to attend college. Ironically, he had helped kids avoid the lure of gangs.

“If he touched you in high school, it set the tone,” Leong said. “Maybe you would go to undergrad, then law school, and then come back and help your community.”

Wada had a budding relationship with another of the five victims, 21-year-old Denise Louie. His dinner companion was an urban planning student at the University of Washington and a member of a Seattle group that aimed to improve and promote that city’s Chinatown. She had met Wada the summer before and was visiting San Francisco with friends over the Labor Day weekend.

“She was a typical activist — very idealistic,” recalled a friend and fellow Seattle activist, Gary Iwamoto. “At that time, there were a whole bunch of Asian communities going through a rebirth.”

The Denise Louie Education Center, a child care center in Seattle, is named in her honor.

The fifth victim was Fong Wong, a 48-year-old waiter who had served Wada and Louie. An immigrant from Hong Kong, he was working late to support a family that included seven children.

Sitting at a nearby table were Howard Green and his friends, many of whom were shot but survived. Green, who was 23 and had just earned a master’s degree from UCLA, had stopped off in San Francisco to see friends on his way to Tahoe.

After two bullets ripped into his left leg through his bell-bottom jeans — which he still owns, bloodstains and all — Green had three rounds of surgery as he went on to a successful career in technology.

Semiretired and living in Los Gatos, he still has some problems with his leg, but said, “There’s a silver lining in this. At the age of 23, I sorted out a view of how fickle and short life can be. It changed my perspective as far as the value of time. This was certainly a wake-up call.”

As the shooters steered toward the restaurant in a stolen car that night, Robert Yuen sat down with Calvin Fong and Donald Kwan at a table in the mezzanine, three steps up from the main dining area.

They all had fake IDs. Kwan was the oldest, at 20, while Fong was 18 and Yuen 19. They had decided to grab a late-night snack — “siu yeh,” they called it, using Hong Kong parlance — after drinking and dancing at a Fisherman’s Wharf disco.

“It was Calvin’s first time at a real nightclub, and he was pretty excited about it,” recalled Yuen.

Fong was the group’s most outgoing member, a recent graduate of Riordan High who worshiped at the same church as Yuen, First Baptist in Chinatown. He was popular and a good dancer, and had planned to stay at Yuen’s house and go to church with him in the morning.

Kwan was a fellow student with Yuen at Abraham Lincoln High, who graduated a year before him and practiced kung fu.

“Lincoln was predominantly white, and we would get picked on,” Yuen said. “He would fight back for us.”

Yuen shared his story recently while walking the streets of Chinatown. Though he always lived in the Sunset, he said he feels at home in Chinatown, where he spent some of the best years of his youth with his friends.

As he spoke, he stopped on Washington Street and pointed to the Golden Dragon’s original awning and jade-green tile facade. The restaurant has changed hands several times over the past decade and is now called Imperial Palace, after the previous owners came under fire for stiffing workers and violating health codes.

Once a premier nightspot with gilded sculptures, carved wood and other lavish details, the restaurant’s main dining room is now less opulent. The new owners say they’re focused on attracting neighborhood residents and regulars with more of a focus on the menu and less on frills. Patronage from tourists alone, they say, can’t sustain a business in Chinatown.

Many diners don’t know what happened there in 1977. But in the kitchen, the big stainless steel vent above the stoves is still dented from a bullet.

What Yuen and his friends didn’t know as they sat in the restaurant that night was they had chosen a table near the intended targets of the shooting, including Wah Ching leader Michael “Hot Dog” Louie, and a 17-year-old member of the Hop Sing Boys, Raymond “Shrimp Boy” Chow.

By hitting the floor at the first sight of the shooters, Chow would go on to become a gang leader responsible for one of Chinatown’s most notorious post-Golden Dragon crimes — ordering the 2006 killing of the leader of a neighborhood fraternal organization. He was sentenced to life in prison last year for that and other crimes.

When Yuen first heard the explosion of gunfire, he thought it might be a prank, possibly kids tossing firecrackers into the restaurant. Then he saw a gunman headed right for his table.

“It was pretty bad,” he said. “I thought, ‘This is surreal. This isn’t happening.’”

Someone pulled Yuen under the table, saving his life. But Kwan was pinned between two people in the middle of the booth, unable to escape the line of fire. Moments later, the assailants fled, leaving a cloud of smoke from the gunfire.

“Donald got shot right in the forehead. I said, ‘Oh my God, he’s dead,’” Yuen said. “I thought Calvin was just upset. I told him, ‘It’s going to be OK,’ then I saw he was bleeding.”

Yuen said he didn’t realize he too was shot until he reached for his stomach — and saw his hand covered in blood. One of his 6-inch platform shoes fell off as paramedics hustled him away on a stretcher.

He woke up days later at San Francisco General Hospital, after the first of several surgeries that kept him hospitalized for three months. He missed his friends’ funerals.

“All I remember is asking at the hospital if Calvin was OK,” he said. “The person I asked started to cry, and then I kind of knew.”

As his body slowly healed, Yuen was confronted with severe emotional trauma.

“They didn’t have therapy for that stuff then,” he said. “I don’t know if it was post-traumatic stress, so I pretty much drank a lot. It kind of dulled everything.” Fortunately, he said, he was “able to quit when I had to.”

He went on to work at restaurants and in the hotel industry, and is now a medical assistant at a doctor’s office. He wonders what life would have been like if he didn’t lose his friends.

“Calvin was likable and charismatic, so I wonder what he would have been,” Yuen said. “Would we still be friends? I like to think we all would have done fairly well.”

Yuen still lives in his boyhood home, 10 years after his mother died. He spends his free time going out with his friends, collecting antiques and reading books he has stacked up by the boxful.

Over the years, he said, he’s taken some comfort in having survived the ordeal.

“If you can get through this,” he said, “you can get though anything.”

Evan Sernoffsky is a San Francisco Chronicle staff writer. Email: esernoffsky@sfchronicle.com Twitter: @EvanSernoffsky