MILWAUKEE — The Brewers quickly solved Jason Hammel on Tuesday night.

Jonathan Villar homered to start a five-run first inning, and the Brewers cooled off the Chicago Cubs with a 12-5 victory.

“We haven’t had a first inning like that,” Brewers manager Craig Counsell said. “He’s been tough against us. You get to him before they get in that rhythm and take advantage of it.”

The NL Central-leading Cubs had won seven of eight and were 41 games over .500 after winning Monday’s series opener.

But Milwaukee rallied from a 1-0 deficit as its first seven batters reached against Hammel (14-8). Villar homered on Hammel’s second pitch, Ryan Braun had an RBI single, Domingo Santana singled in two runs and Martin Maldonado added a sacrifice fly.

Hammel allowed more runs to the Brewers in the first inning Tuesday than he had in any of his 14 previous career outings against them; he entered with at 10-1 with a 2.50 ERA against Milwaukee.

Wily Peralta (6-9) gave up four runs and six hits in 7 2/3 innings, leaving after Anthony Rizzo’s second home run of the game, a two-run drive. Peralta became the first Brewers starter to pitch into the eighth since Junior Guerra on July 29.

Peralta retired 11 consecutive batters after Ben Zobrist’s single in the third. He recorded the first two outs of the eighth before Zobrist kept the inning alive for Rizzo with a double.

Optioned to Triple-A after compiling a 6.31 ERA in his first 10 starts, Peralta has a 3.35 ERA in six starts since his Aug. 8 recall.

“All of my starts since I’ve coming back up have given me confidence because I’m throwing the ball better,” Peralta said. “I’ve been executing my pitches better.”

Given a lead on Rizzo’s first-inning homer, Hammel allowed nine runs — eight earned — and 13 hits in 5 2/3 innings.

“Just too many pitches up in the zone,” Hammel said. “I didn’t really set the tone for us early. This one is on me. Obviously, it doesn’t sit well, but we’re fortunate have a very comfortable lead right now. I’ll just brush this one off and move on.”

After allowing the five runs in the first, Hammel allowed just an unearned run over the next four innings, then gave up the three-run home run to Braun in the sixth.

“Usually if they are going to get him it is going to be early in the game,” Cubs manager Joe Maddon said. “When he gets deeper into the game he usually settles in. I thought he did settle in. Obviously, the three looks bad at the end.”

Hernan Perez had a career-high four hits for the Brewers. Milwaukee had 16 hits, including three each by Villar and Santana.

Braun hit a three-run homer in the sixth for a 9-2 lead.

FAMILIAR FOE

Rizzo is 16 for 32 with seven homers and 14 RBIs against Peralta.

“I’m going to try to find a way to get him out,” Peralta said. “I feel like I made two good pitches to him. You have to tip your hat to him. He’s been killing me.”

TRAINER’S ROOM

Cubs: Activated from the disabled list prior to Tuesday’s game, RHP Hector Rondon allowed a run in his first inning since Aug. 16.

Brewers: Milwaukee recalled RHP Damien Maginfico and C Andrew Susac from Triple-A Colorado Springs and RHP Taylor Jungmann from Double-A Biloxi on Tuesday.

UP NEXT

Cubs: LHP Mike Montgomery (1-1, 4.09 ERA) will start the series finale against the Brewers. He has a 4.01 ERA in five starts and a 2.29 ERA in 37 relief appearances for Seattle and Chicago this season.

Brewers: RHP Matt Garza (5-6, 4.57) will pitch against his former team for the second time this season. He has allowed just one earned run over 12 1/3 innings in his past two starts.