Fans of the San Francisco Giants and Los Angeles Dodgers have sustained one of the most passionate rivalries in American sport for more than a century, starting when both called New York City home and enduring through a cross-country move that placed them in California cities that — fittingly — also are rivals.

Visiting fans clad in their team’s colors could always expect ridicule, and sometimes worse, in the stands. But now, for the second time in three seasons, serious violence outside the stadium has marred the rivalry.

Two years ago, Giants fan Bryan Stow suffered permanent brain damage when he was attacked in Los Angeles. This time, Dodgers fan Jonathan Denver died after being stabbed Wednesday night in San Francisco.

The latest incident has shaken and saddened fans of both teams.

“It’s real unfortunate. It is just a game after all,” said Brian Chew, a Giants fan from San Bruno who attended Thursday’s game against the Dodgers.

“We have bigger purposes in life than just orange and black or blue and white,” he added, referring to the Giants’ and Dodgers’ colors.

Jonathan DenverAP

Police say Denver, 24, was with his father, older brother and two other people a few blocks from the Giants’ ballpark when they exchanged words with some Giants fans.

There was a moment of silence for Denver before the Dodgers hosted the Colorado Rockies on Friday night.

The killing happened more than an hour after a Giants-Dodgers game that — beyond the rivalry — had little consequence. Though the Giants are the reigning World Series champions, they muddled through a disappointing year while the Dodgers overcame a slow start to win the division.

A security guard checks an arriving Dodgers fan at AT&T Park.AP

Games between the two teams often have a playoff-like intensity, regardless of the teams’ positions in the standings. “Beat LA!” is the crowd’s refrain when the Dodgers play at the Giants’ waterfront ballpark; “Giants suck!” cascades around Dodger Stadium.

Fans relish the demise of their rivals nearly as much as the success of their own team. The highlight of the Dodgers’ 1993 season came on the last game of the year when LA drubbed the Giants 12-1. The loss knocked San Francisco out of the playoffs, despite 103 victories.

The rivalry extends from the field to the stands to the streets, and has long been mixed up in identity politics.

For much of the early 20th century, the Giants were “the darlings of New York City,” favored by stockbrokers, politicians and the Broadway set, said John Thorn, Major League Baseball’s official historian. The Dodgers, meanwhile, attracted support from immigrants and others outside the mainstream and were often identified as underdogs, even as they began to field powerhouse clubs in Brooklyn in the 1940s and 50s.

Both teams left New York following the 1957 season steeped in the joy of beating the other. Appropriate, then, that they relocated to California cities with clashing cultures.

To many a San Francisco native, Los Angeles is that place where shallow people transformed by plastic surgery dwell on whose car is better while they douse their lawns with water stolen from Northern California. If Los Angelenos think about San Francisco, it’s a foggy bastion of we’re-better-than-you snobbery clinging to a 1960s counterculture that has faded, save for the tie-dyed T-shirts of its tourist traps.

“Tensions between Northern and Southern California I think feeds into it and help the rivalry along considerably,” said Daniel Durbin, a University of Southern California professor who studies the social and cultural impact of sports. “There’s a bit of a leap between that, though, and actual violence.”

Still, violence has been part of the rivalry. In 1938, Brooklyn fan Robert Joyce shot and killed a fellow bar patron and bartender after an extended “ribbing” by Giants fans.

The rivalry produced one of the most infamous on-field confrontations in Major League history in 1965. While batting, Giants ace Juan Marichal thought Dodgers catcher Johnny Roseboro was trying to hit him when he threw the ball back to the mound. Marichal clubbed Roseboro in the head with a bat, sparking an extended, bench-clearing brawl. Roseboro wasn’t seriously hurt.

In 1981, a year when the Dodgers won the World Series and the Giants were also-rans, LA outfielder Reggie Smith went into the stands at San Francisco’s Candlestick Park to confront a heckling Giants fan.

The Giants won the World Series in 2010 and so tensions were high when the Dodgers opened the 2011 season at home against San Francisco. Stow, a Northern California paramedic, was among the Giants fans in attendance. While walking to the stadium parking lot after the game, he was attacked and hit his head on the pavement when he fell.

The most recent victim of fan violence, Denver, was born in Los Angeles County but was living in Fort Bragg, about 170 miles north of San Francisco. He attended Wednesday’s game with his father, Robert Preece, who worked security on game days at Dodger Stadium.

On Friday, Denver’s grandparents reflected the sentiments of many, writing in a public statement that “this incident underlines a symptom of a society whose values seem to have deteriorated over time.”

Robert Sr. and Anne Marie Preece also expressed appreciation for “all the kind expressions of sympathy” — especially from the family of Stow, with whom their grandson will now be linked.