PHOENIX -- Orlando Hudson expected to take the day off Wednesday.
The Arizona second baseman ended up having a big day instead.
Inserted into the lineup a few minutes before game time, Hudson tied a career high with four hits to lead the Diamondbacks to an 8-7 victory over Pittsburgh and a sweep of their three-game series.
Diamondback manager Bob Melvin had planned to leave the slumping Hudson, who was hitting .218, out of the starting lineup. But Melvin had to scramble when Damion Easley suffered a back spasm shortly before the game.
Hudson was taking some swings in a batting cage below the grandstand when he learned he was starting.
"My body wasn't prepared for it," Hudson said. "I was tight going out there."
It didn't show. Hudson went 4-for-4, all singles, to raise his batting average 20 points. He scored a run and drove in another.
"I had a tougher time scrambling to get the lineup card right than he did preparing to get into a ballgame," Melvin said. "I was trying to give him a day off to clear his mind a little bit, and he goes out and does what he did. That's a pretty impressive performance."
That's how things have been going for the Diamondbacks, who held onto first place in the NL West as they hit the road for a 10-game trip to Cincinnati, New York and Atlanta. The victory wrapped up a 7-2 homestand for the Diamondbacks, who also won series against San Diego and Atlanta.
A year ago, the Diamondbacks went 36-45 at home. This year, Arizona is 17-9 at home after a 2-5 start.
"I think it's been contagious," Melvin said. "We didn't start out well. It's nice to play well at home. You sleep better, you go out and eat better."
The Diamondbacks' hot streak has yet to pay off at the gate. Wednesday's victory drew 18,394, the third-smallest crowd in franchise history. Arizona's three smallest crowds came on the nine-game homestand that ended Wednesday.
Those who showed up for a rare weekday afternoon game saw the Diamondbacks nearly blow an easy victory over the woeful Pirates, who have lost four straight and six of seven. The Diamondbacks led 8-3 heading into the eighth inning but had to hold their breath as closer Jose Valverde flirted with disaster.
Freddy Sanchez hit an RBI single off Valverde in the ninth and Jason Bay added a sacrifice fly to get Pittsburgh within one. But Valverde got Craig Wilson to fly out to the wall in left-center with Sanchez on first for his 14th save in 15 chances.
"For a second there, I was thinking I might have to scale the wall," said left fielder Andy Green, who drove in a career-high three runs.
It was the second time in three days that Valverde was credited with a save despite allowing two runs to the Pirates, whose .252 team batting average ranks 13th in the National League. Valverde refused to speak to reporters after the game.
Earlier Wednesday, the Diamondbacks traded starting pitcher Orlando Hernandez to the New York Mets for reliever Jorge Julio, who had 83 saves for Baltimore from 2002-2004. But Melvin dismissed speculation that the club might be ready to replace Valverde.
"He's our closer, period," Melvin said.
Miguel Batista (4-2) allowed two earned runs and seven hits in six innings for Arizona.
The Diamondbacks jumped ahead on Eric Byrnes' first-inning solo homer off Zach Duke (2-6), who allowed four earned runs on nine hits in six innings. An inning later, Wilson tied it at 1 with his eighth home run. Wilson went 4-for-5, adding three singles to tie a career high for hits.
Then the Pirates had trouble in the field, as they had throughout the series here.
Arizona made it 4-1 in the third when second baseman Jose Castillo committed errors on consecutive batters.
The Diamondbacks made it 8-3 on Green's bases-loaded double in the seventh off reliever Salomon Torres. But Bay cut the lead to 8-5 in the top of the eighth inning with his 13th home run.
"It would be a lot more enjoyable to have this personal success if we were winning," Bay said. "It's great that I feel good, but the main thing here is winning so it makes it a lot tougher to relish it."
- Arizona extended a club record by turning a double play for the 15th straight game.
- New Arizona State men's basketball coach Herb Sendek, a Pittsburgh native and a lifetime Pirates fan, threw out the ceremonial first pitch.
- Byrnes has hit in nine straight games, a season high.
- Easley pinch-hit in the eighth and popped up.