SAN FRANCISCO — The last time the San Francisco Giants won the World Series being never, legions of pent-up fans packed bars and public plazas Monday around the Bay, restless tension turning to deliverance with the team’s clinching win more than 1,700 miles away.

They came, they saw, they reveled into the night.

Gleeful, screaming masses flooded the South of Market district around AT&T Park in San Francisco within minutes of the final pitch, halting Muni railcars in their tracks, clogging streets, spraying champagne and beer, streaking. Five police officers surrounded the statue of Willie Mays at the ballpark’s main entrance to keep fans from clambering up its twisted bronze.

As the evening wore on, the crowds became rougher. Several fistfights broke out in the Mission District, and at 21st and Mission streets, a crowd blocked the intersection as a police helicopter hovered overhead, moving its spotlight over the people below.

Two mattresses went up in flames in the intersection at a little after 11 p.m. and minutes later crowd began to thin as police in safety helmets and patrol cars moved down Mission Street herding people toward 20th and other side streets off Mission.

The dispersal revealed a car stalled in an intersection with slashed tires and smashed windshield. Firefighters were treating a person who had been in the passenger seat, apparently unconscious.

Officers officially declared an unlawful assembly at about 11:30 p.m., and continued dispersing the crowd past 16th Street until it had thinned to safe levels.

About midnight, a car was smashed at the intersection, and two people were taken to the hospital. Their conditions are unknown.

Earlier, the exuberant celebration was purely high-spirited.

Painted up like a Halloween ghost, Alex Maricic, 19, of San Francisco, made a break for the statue after the last pitch, then reversed course at the sight of police and plunged into a crowd.

“This is the end of the torture! We’ve excised all ghosts of the Giants’ past,” the Menlo College student shouted.

San Francisco police reported no early violence — only loudness and bare breasts — and let the party cut loose down Market Street. Later, more than two dozen fans clambered atop a stopped Muni bus at Seventh and Market streets as other hung from its mirrors.

Scores of orange bottle rockets launched from a news van, while sisters Eileen and Maureen McCrystle ran into the street from a nearby condominium, dripping champagne and tears.

“I’m so happy, I can’t believe it,” Eileen said, bawling.

A victory parade at 11 a.m. Wednesday in downtown San Francisco will celebrate the championship.

As the eighth inning gave way to the last, workers at AT&T park lit gas-fired generators and security guards hauled out boxes of championship hats and pins — prepping to sell from a merchandise trailer within seconds of the championship.

A few miles away at City Hall Plaza, a giant-screen broadcast drew a crowd of thousands that came unhinged during a seventh-inning rally climaxed by shortstop Edgar Renteria’s three-run home run, then held a colossal roar for more than 10 minutes after the game. Marijuana and victory mingled across the crazed but peaceful crowd under a City Hall bathed in an orange glow. Fans relished their team, and their own patient loyalty.

“I waited 17 years for this, from the time I was 6 years old and my dad took me to my first game,” said a breathless Stanley Chow, of Oakland, holding an “It’s destiny” sign.

“The city is handling its close-up really well,” said San Franciscan Joe Kukura, 39. “We’re repping our team better than any team in the (playoffs).”

Atop a bus, El Cerrito High School graduate Ashkon Davaran led a crowd into his Giants fan redo of Journey’s “Don’t Stop Believing,” which went viral on the Web during the team’s playoff run. His father, Ardavan Davaran, was a “huge” Giants fan before his death last year, Davaran said.

“I’ve been feeling his presence the whole time,” he said. “For this to happen right in the wake of that is something pretty special.”

The celebration spread into the suburbs, where revelers sang in unison with Journey’s “Don’t Stop Believing” inside McCovey’s Restaurant in Walnut Creek, then launched into a “Let’s go Giants!” chant in the ninth. The final pitch brought an unleashing of car horns throughout downtown.

“I have been a Giants fan since I was 7,” said Ritch Cuerdo, 37, an usher at AT&T Park. “To see the game with the fans and actually get to enjoy it — it doesn’t get better than this.”

In San Leandro, the seventh-inning blast eased palpable tension at Ricky’s Sports Theatre, where an eruption accompanied the final strikeout in a dream season. Orange pom-poms shook. High-fives slapped. Jagermeister went down. Mostly, though, fans whipped out their cell phones to take pictures of the 87 television screens in the bar and to thumb text messages to friends.

The game lived up to the hype, said Modesto resident Charles Burleigh, 47.

“I knew it was going to be a pitcher’s duel. They are probably the best two pitchers in the league. It doesn’t get any bigger than this.”

Gov. Arnold Schwarzenegger, in a last statement before voters take to the polls to replace him, cheered the victory with a political jab.

“The San Francisco Giants defeated the Texas Rangers tonight, just like California voters are going to defeat the attempts of dirty Texas oil companies to undo our clean energy laws at the polls tomorrow,” he said in a tone-deaf media release.

Back around the ballpark in San Francisco, fans streamed into a nearby Safeway store, emptying the shelves of cheap champagne. Store clerk Mario Banos stood amazed.

“We’re almost out of it. It’s just a crazy night,” Banos said. “One of the best nights ever, ever, ever.”

Staff writers Kristen Bender and Roman Gokhman contributed to this story.