KANSAS CITY, Mo. — A new baseball dynasty was born Wednesday night out of the legacy of an old baseball institution.

The San Francisco Giants, who started play in 1883 as the New York Gothams and moved to California 75 years later, brushed aside daunting odds and a royal blue sea of 40,000 fans to win their third World Series title in the last five years and the franchise’s eighth of the modern era, the first in 1905.

The Giants beat the Kansas City Royals, 3-2, in Game 7 at Kauffman Stadium and became the first team since the 1979 Pittsburgh Pirates to win a Series Game 7 on the road. They also became the second team, after the Boston Red Sox, to win three championships in the 21st century.

“I’m numb through all this,” said Manager Bruce Bochy, who was at the helm of all three Giants title runs. “You’re so blessed or fortunate to get in the World Series and get to one; it just doesn’t happen very often. I’m amazed at what these guys did.”