The celebration in San Francisco's streets over the Giants' World Series victory turned raucous and violent in some areas with people injured by gunfire, officers hurt by bottles thrown by revelers, and police making arrests.

The partying unfolded peacefully with fans gathering in the streets and uncorking champagne, lighting bonfires, dancing in a mosh pit and hugging strangers Wednesday night as their team scored its third series win in as many championship appearances, a triumph all the more gratifying by its arrival at the end of a seventh, winner-takes-all 3-2 game.

"I knew they were going to win. It's the Giants. They do this all the time," San Francisco native Barbra Norris, 54, said of the team's odds-defying win in an away game played the night after a crushing shutout in Kansas City.

But in some areas, the atmosphere grew rowdier as the night wore on.

Violence left three people injured in separate incidents, two by gunshots and one in a stabbing, said Officer Gordon Shyy, a police spokesman. The gunshot victims' wounds were not life-threatening, but he didn't have information on the stabbing.

Shortly after the celebrating began, Shyy said officers made "a handful of arrests" as fans filled the streets and blocked traffic around the Civic Center, in the Mission District and on Market Street within walking distance of AT&T Park. No updated arrest figure was available later.

"Police personnel were assaulted with bottles on Market Street and Mission district. Officers in the Southern district were also struck with bottles," Shyy said. "These objects were thrown at officers as they attempted to disperse crowds and assist firefighters extinguish bonfires."

Shyy said multiple officers suffered minor injuries, but did not provide an exact number. He also said one was treated at a hospital for injuries.

The San Francisco Chronicle reported that the region around Third and King streets was especially raucous with thousands of fans spraying beer, smashing bottles, lighting fires and setting off fireworks. That prompted police in riot gear to move in and set up a perimeter.

At one point, riot police lined up three rows deep, leading people to hurl bottles, some shattering on the street and others hitting cringing officers, the newspaper reported.

The wild street scenes lasted into the early hours Thursday. Shyy said crowds were still in the streets in some areas and stoking bonfires shortly after midnight, and officers continued to try to clear the areas. But by 1:30 a.m. PDT, he said crowds had dispersed for the most part.

Earlier in the evening, across from San Francisco City Hall, where the exterior lights had been glowing orange all week, more than 9,000 people gathered in an outdoor plaza where the city had set up a Jumbotron and a vendor sold hot dogs — but no beer.

"You come out here to feel the pulse of the city. When it's the seventh game, you want to get the vibe," said Geoff Goselin, 61.

The diverse crowd sang "Let's Go, Giants" whenever their counterparts 1,800 miles away rooted for the home team and chanted a prophetic "M-V-P" whenever Giants ace Madison Bumgarner took the mound.

"Bumgarner is the beast, the man," Aden Bacus, 41, shouted after the exhausted pitcher secured a series of strikes on the heels of giving up a gasp-inducing triple. "I'd be lying if I told you I wasn't nervous there at the end."

Amid the revelry, Mayor Ed Lee said the city would host a parade and celebration for the team Friday.

San Francisco police maintained a heavy presence but kept a cool distance as marijuana smoke wafted over Civic Center Plaza and jubilant fans set off fireworks and popped open cans of Pabst Blue Ribbon someone sold out of a cooler.

One indication of the mood was that several fans said they would have been able to stomach a Royals victory with a shrug, if not a smile.

"It would have been really cool for Kansas City to win the World Series at home," said David Janmohamed, 23.

___

Seavey reported from Phoenix.