SAN FRANCISCO -- The San Francisco Giants needed every available player on their roster to stay unbeaten in what turned into a marathon home opener.
Aaron Rowand drove in the winning run with two outs in the 13th inning on an infield single, salvaging the Giants' season debut in their waterfront ballpark and keeping alive their unbeaten start with a 5-4 victory over the Atlanta Braves on Friday.
"We're just trying to keep it rolling -- 4-0 is not too bad," Rowand said. "It definitely gives you some momentum, some confidence."
It was the fifth game-ending hit of Rowand's career and scored Juan Uribe, who drew a one-out walk from Kris Medlen (0-1) before stealing second. Uribe went to third on catcher Brian McCann's throwing error, and Rowand brought him home.
Not without some flair for the dramatic: a headfirst dive into first base.
"I have no idea how close I was. I have no idea where the ball was," Rowand said. "All I know is I was safe."
Jeremy Affeldt (2-0) pitched one inning for the win in the longest game in the majors this season and the longest home opener in San Francisco history.
Edgar Renteria hit a tying two-run homer off Braves closer Billy Wagner with one out in the ninth. Atlanta manager Bobby Cox was ejected in the top of the 13th for arguing balls and strikes, the 154th ejection of his career.
"Great game. Quite an opener," Bochy said.
San Francisco rallied from an early 3-0 deficit after a dazzling season debut by Braves starter Tim Hudson. At 4-0, the Giants are off to their best start since winning their first seven games in 2003, their last playoff year.
Both teams missed early chances to end it.
San Francisco closer Brian Wilson pitched a 1-2-3 10th, striking out sensational rookie Jason Heyward to end the inning, before loading the bases in the 11th. Sergio Romo relieved and got Troy Glaus on a flyout.
In the 12th, San Francisco slugger Pablo Sandoval led off with a double and went to third on Andres Torres' sacrifice, but the Giants couldn't convert. Torres was San Francisco's last available position player.
The Giants' last home opener of 13 or more innings was a 14-inning affair won 4-2 by the Boston Braves on April 20, 1917.
Bochy has said all along Renteria deserved a chance to show what he can do healthy. He played in pain all last year and was limited to 124 games in his first season with the Giants, largely because of two aching shoulders and a troublesome right elbow that required surgery late in the season to remove bone chips and spurs.
"When you play a guy like Billy Wagner, he's one of the best relievers in the game," Renteria said. "So I got lucky on that one."
He's 11-for-16 (.388) with three multihit games already this season.
"Thanks, Edgar," Rowand said.
"Edgar's been the man," Mark DeRosa added.
Renteria's one-out single up the middle in the fourth marked the Giants' first baserunner against Hudson, who allowed three hits and two runs, struck out two and didn't walk a batter in an impressive seven-inning, 77-pitch outing on a spectacular, clear day in the Bay Area.
"It was a good game for me," Hudson said. "I felt pretty good I was pounding the strike zone and staying down in the zone with some sinkers and changing speeds. I was just going out there being aggressive, keeping my defense in the game and was able to get pretty deep in the game."
The Braves had a good feeling about Hudson's comeback from Tommy John surgery, giving the hard-throwing right-hander a $28 million, three-year contract in November.
"He's got a new arm," Cox said before the game.
While it was a tough first travel day for the Braves, they didn't play like a team that just flew across the country. They landed in San Francisco early Friday following a home game the previous night against the Chicago Cubs, arriving at the hotel a little before 2:30 a.m.
"We play the schedule," Cox said. "Where they tell us to go we go."
Heyward, coming off his first hitless outing Thursday after going 3-for-8 in the opening two games, had four strikeouts and a walk. He hit a monstrous 451-foot, three-run homer on his first major league swing Monday.
The two new guys in the middle of the Giants' order after Sandoval -- cleanup hitter Aubrey Huff and No. 5 man DeRosa -- went a combined 0-for-7 in their first home game. ... The Braves stranded 14 baserunners to the Giants' two. ... Two-time reigning NL Cy Young winner Tim Lincecum will receive his award before Saturday night's game. ... The Braves were swept in a three-game series at AT&T Park last season and are 12-22 since the ballpark opened in 2000, their worst road winning percentage. ... Jerry Rice threw out the ceremonial first pitch caught by his former 49ers quarterback and fellow Hall of Famer Steve Young. Rice then ran a route and Young tossed the ball to him.