His manager considered taking him out after eight innings Tuesday night, but St. Louis Cardinals ace Adam Wainwright lobbied successfully to finish what he started.

"I told him, 'Give me 12 pitches and then you can lift me,'" Wainwright said.

Mike Matheny didn't have to bring the hook with him.

Wainwright needed only nine pitches in the ninth to polish off the first one-hitter of his career. He blanked the Arizona Diamondbacks 5-0 at sold-out Busch Stadium.

First baseman Paul Goldschmidt was all that stood between Wainwright and perfection, as he lined a fourth-inning double off the wall in deep right-center. Wainwright (7-2) fanned nine and threw 86 of his 115 pitches for strikes.

A Diamondbacks offense that entered the game hitting .287 and slugging .457 in May was no match for Wainwright. He got six of his strikeouts looking, including reigning National League co-Player of the Week A.J. Pollock twice.

"He's one of the two or three best pitchers in the game," Goldschmidt said of Wainwright. "He was able to put everything down and away where he wanted it. He didn't make many mistakes, that's for sure."

Arizona manager Kirk Gibson agreed with Goldschmidt.

"You've got to tip your cap to him tonight," Gibson said of Wainwright. "He had everything working. We didn't have an answer for him tonight."

It was clear early that Wainwright was dealing. He got three of the first six hitters to look at third strikes and needed only 30 pitches to get to the fourth inning. Even after a 15-minute delay caused by the exit of plate umpire Brian O'Nora due to illness, Wainwright never missed a beat or a corner.

It was the 18th career complete game and eighth career shutout for Wainwright, who worked with two extra days of rest after a rainout last week and Monday's off day.

"I don't admit it often, but this time, I needed a day off," he said. "Two extra days was even better. It allowed me to get two extra lifts in between my last start. I got some good conditioning in, so I needed it."

Meanwhile, the Cardinals' offense tagged Bronson Arroyo (4-3) for nine hits, seven going for extra bases, and five runs over seven innings. Arroyo, who walked none and fanned six, allowed just three runs in his previous 29 2/3 innings.

Included in St. Louis' 10 hits were two homers, the team's first since May 9 in Pittsburgh. First baseman Matt Adams' two-run shot in the first inning gave Wainwright all the offense he needed. Shortstop Jhonny Peralta capped the scoring with a 444-foot bomb over the left-center-field wall with two outs in the sixth.

In fact, all of the Cardinals' scoring came with two outs.

"We took some good at-bats tonight," Matheny said. "Runs with two outs are huge. We did a good job bunching our hits together."

Peralta also rifled an RBI double in the fourth, while left fielder Matt Holliday collected a run-scoring single in the fifth, moving him within nine RBIs of 1,000 for his career.

St. Louis (24-21) won for the sixth time in eight games, drawing within 2 1/2 games of the first-place Milwaukee Brewers in the National League Central. The Diamondbacks fell to 18-29.

Matheny took Wainwright out of a couple of games this season in which he cruised through eight innings and had a big lead. This time, Matheny gave Wainwright just enough rope to finish what he started.

"That was something, wasn't it?" Matheny said. "He only had one baserunner to worry about today. It was one of those days where he had a great feel for everything he threw."

NOTES: St. Louis activated RHP Jason Motte from the disabled list and optioned LHP Sam Freeman to Triple-A Memphis. Motte hasn't pitched since 2012, sitting out last year after undergoing Tommy John surgery in May. He completed a rehab assignment Thursday night. ... Arizona 2B Aaron Hill (shoulder) didn't play for the third consecutive game. He again was replaced by Cliff Pennington, who went 0-for-3. ... The Cardinals gave CF Peter Bourjos the night off, starting Jon Jay, who entered the game with a .378 career average in 37 at-bats against Diamondbacks starter Bronson Arroyo. Jay went 1-for-3.