It was the first ever perfect game by a Giants pitcher. Here is the final out.
Cain dominated the Astros hitters all night long and struck out 14 batters.
Cain tied Sandy Koufax with the most strikeouts in a perfect game. Cain almost had a no-hitter in April against the Pittsburgh Pirates, but Pirates pitcher James McDonald hit a single off Cain.
There were some close calls, though, as Chris Snyder almost hit a homer, but left fielder Melky Cabrera made a great catch.
In the seventh inning, Gregor Blanco made a diving catch in right field to rob Jordan Schafer of a hit.
This was the fifth no-hitter thrown against the Astros in their history.
The Giants won the game, 10-0. It was the 22nd perfect game in MLB history.
Here is the postgame interview with Cain.
Before the game, Cain participated in a driving competition with pro golfer Dustin Johnson. Here's video footage of what happened.
The sold-out crowd at AT&T Park was cheering for the perfect game since around the fifth inning. They knew something special was happening that night.
Once Blanco made the diving catch in the seventh inning, fans were on their feet for every pitch by Cain.
Cain's wife, Chelsea, was escorted onto the field after the game by a policeman and hugged her husband.
It was a great night to be a Giants fan, and the crowd was into the game as much as they were during the 2010 World Series and during the milestone homers by Barry Bonds over the years.
The Giants go for the sweep this afternoon against the Astros, with Barry Zito on the mound taking on fellow lefty Wandy Rodriguez.