SAN FRANCISCO - Buster Posey hit a two-run homer in the first inning and drove in three, Tim Hudson pitched seven strong innings and the San Francisco Giants won their fifth straight, beating the Atlanta Braves 4-2 Friday night.

Hudson (3-4) gave up one run on five hits, striking out four and not walking a batter as he beat his 29th major league team. That left the Oakland Athletics, his first team, as the only one he has not beaten.

Mike Foltynewicz (3-2) was nearly as effective, retiring 11 in a row at one point. He gave up the two runs on five hits, walking one and striking out a career-high eight.

Freddie Freeman blasted his sixth homer of the season, a solo shot that easily cleared the centre field fence in the ninth.

Foltynewicz recorded four outs in the seventh, including three on strikes, though two runners reached base on a wild pitch and the bases were loaded when he was replaced by Luis Avilan, who got Nori Aoki to ground into a forceout.

Posey added a ground-rule double in the eighth, scoring Joe Panik, who walked and stole second. Brandon Crawford, who had two hits, also singled in a run as the Giants moved into first place for the first time since opening day.

Hudson retired 13 of the final 14 batters he faced. He got 14 outs on grounders and struck out four.

Hunter Strickland pitched the eighth and Santiago Casilla got the final three outs for his 15th save in 17 chances, despite walking two.

Cameron Maybin had two hits and drove in a run for the Braves, who lost their fourth in five games. Andrelton Simmons also recorded a pair of hits and scored a run.

Giants pitchers went 39 consecutive scoreless innings at home before Maybin's third-inning single, matching a franchise record.

The Giants improved to 21-7 in May, matching their best record in any month since August of 1968. The franchise record is 24 wins in June of 1954.

CROSS CHEERING

When cameras zoomed in on NBA MVP Stephen Curry, sitting in the front row with his wife and Giants' president Larry Baer, the sellout crowd went into a frenzy, giving him a loud, sustained standing ovation, which included chants of "MVP! MVP!" Curry was wearing a San Francisco jacket and cap.

TRAINER'S ROOM:

Braves: OF Joey Terdoslavich (left wrist sprain) was 1 for 4 with an RBI in his first rehab game with Double-A Carolina. The Mud Cats beat Myrtle Beach, 2-0.

Giants: RHP Jake Peavy (back strain) and the Giants have decided to slow down his rehab assignment following his subpar outing Wednesday night.

UP NEXT:

Braves: RHP Williams Perez (0-0, 4.05) will make his third start Saturday night, facing the Giants for the first time. He's excelled in his first two starts, both no-decisions. He's allowed two runs in 11 innings on 13 hits, walking two and striking out 14.

Giants: RHP Tim Lincecum (5-2, 2.56) looks to continue his strong start to the season. He did allow three home runs in a victory over the Milwaukee Brewers in his last start. He's 9-6 with a 2.76 ERA in 15 starts against the Braves, beating them twice last year.