Jeff Samardzija struck out nine batters en route to his first career complete game, as the Chicago Cubs downed the Pittsburgh Pirates, 4-3, in the middle contest of a three-game set Saturday at PNC Park.

Samardzija (9-13) allowed just three runs -- two earned -- on four hits and one walk to snap a four-start winless drought.

David DeJesus smacked a go-ahead RBI single in the eighth and Alfonso Soriano added a solo shot to help the Cubs secure their second straight victory on the heels of a six-game slide.

"It was a special night for him," Cubs manager Dale Sveum said of Samardzija. "It was big for him to be that so-called number one guy to step up and give us back-to-back wins."

Jason Grilli (1-5) was tagged with the loss for giving up DeJesus' base hit in the eighth. Pedro Alvarez knocked in two runs for the Pirates, who have dropped six of their last eight games.

Pittsburgh tied the game in the seventh on Jeff Clement's two-out, RBI single into right field, but Chicago answered in the next half inning.

Facing Grilli, Welington Castillo singled to start the frame before Tony Campana worked a two-out walk.

DeJesus then laced a single into right field and Castillo slid in just ahead of Alex Presley's throw to the plate, giving Chicago a 4-3 edge.

Samardzija finished things off by retiring the Pirates in order over the final two frames.

Earlier in the game, Alvarez's two-run, bases loaded single gave the Pirates a 2-0 lead in the first inning, but Soriano launched the first pitch of the second frame into the left-field seats to cut the margin in half.

The Cubs tied the game in the third as Campana and DeJesus each singled to put runners on the corners before a double-play ground out from Luis Valbuena scored Campana.

The visitors then took the lead in the fifth when Campana got the frame started with a ground-rule double. Campana quickly stole third and, after a walk to DeJesus, crossed home on Valbuena's sacrifice fly to left field to give the Cubs a 3-2 lead.

Clement then tied the game in the seventh with a pinch-hit RBI single off the base of the wall in right field to score Josh Harrison.

"He's been battling," Pirates manager Clint Hurdle said of Clement. "To show up the way he did tonight, late, tie the ball game...big swing of the bat for him."

Game Notes

It was Samardzija's last start of the season. The Cubs went 6-5 in his last 11 outings ... Pittsburgh starter James McDonald gave up three runs on seven hits and two walks over 5 2/3 frames ... Pittsburgh still leads the season series, 6-5.