OAKLAND, Calif. -- The Arizona Diamondbacks' miserable month is over.
"Is it really?" manager Bob Melvin asked. "Thank God. I'm not a month-to-month guy ... but good riddance to June."
And Arizona headed into July on a positive note.
Eric Byrnes scored the go-ahead run against his former club on a wild pitch in the seventh inning and Shawn Green drove in two runs in the Diamondbacks' 6-4 victory over the Oakland Athletics on Friday night.
After Byrnes scored, Johnny Estrada singled in a run and Green followed with his second double of the game for Arizona, which ended a three-game losing streak with only its fourth win in its last 24 games. Estrada went 3-for-5 and scored two runs.
"It's nice to get a win," Byrnes said. "It was a long month. June is over."
Mark Ellis' two-run double in the sixth pulled the A's within 3-2, then Adam Melhuse followed with a tying single to center before the Diamondbacks' offense responded against Brad Halsey (3-3). Melhuse doubled in a run in the eighth.
Ellis made a strong return from the disabled list after nursing a broken right thumb.
"It felt good. A month is a long time to miss," he said. "You don't realize it until you get out there."
Claudio Vargas (7-4) pitched six solid innings to end a four-start winless stretch -- two losses followed by two no-decisions -- and get his first victory since beating the Braves on June 3. He allowed three runs and six hits, struck out five and walked three. Jorge Julio pitched the ninth for his seventh save in eight chances as the A's had their season-high eight-game home winning streak snapped.
"All the time I try to go out there and pitch good, even if we've won a lot of games in a row," Vargas said. "I try to do my job."
The Diamondbacks finished their terrible June with a much-needed win a night after being swept by the Seattle Mariners. Arizona started the month by taking four straight from the Braves in Atlanta, then went 4-20 the rest of the way.
This time, the Diamondbacks rallied after Oakland tied it -- something they have had a tough time doing lately.
"We had to," Byrnes said. "It was so important to make a statement and come back."
A's designated hitter Frank Thomas also was activated from the DL after missing 13 games with a strained right quadriceps muscle but had his eight-game hitting streak snapped. Ellis had been sidelined since May 31, missing 26 games. Ellis played four games for Sacramento this week in a rehab assignment.
Ellis came into the game 1-for-24 in his last seven games and 4-for-40 over his last 11. He drew a walk in the second and singled to left in the fourth before his double.
"The way we've been swinging the bats lately, we couldn't give up any more runs," A's manager Ken Macha said. "It was nice getting Ellis back. He swung the bat well, but we have guys struggling in the lineup."
The Diamondbacks got four straight hits off Kirk Saarloos to start the fourth, including an RBI single by Green that scored Luis Gonzalez after he led off with a double. Jeff DaVanon added a sacrifice fly to make it 3-0.
Chad Tracy hit a run-scoring single in the second for Arizona, which is 2-11 in interleague play. The Diamondbacks beat the A's in a series opener for the first time in five meetings.
Saarloos, facing the Diamondbacks for the first time since 2003 while with the Houston Astros, hadn't allowed more than two earned runs in his previous three outings in June. He made his first start since June 17, when he had a no-decision against the Los Angeles Angels in a 5-4, 17-inning A's win.
Oakland finished a successful June as usual, going 18-8 for the month after a 12-17 May.
Macha planned to give Nick Swisher a "mental" day off but needed to play him in left field and batted him second. Swisher struck out five times Thursday to match an Oakland record, the sixth time it's happened. He went 0-for-4 with a walk.
Byrnes, a former member of the A's who's from the Bay Area, received a warm ovation from the crowd before the game.
Oakland 3B Eric Chavez missed the game with inflammation in his forearms. ... The A's optioned INF Mike Rouse and OF Doug Clark to Triple-A Sacramento to make roster room for Thomas and Ellis. ... Byrnes left 20 tickets for family and friends. "I've learned how to say no," he said with a smile. "It's good to be home and good to sleep in my own bed." ... Vargas faced the A's for the first time. ... Halsey had been 2-0 with a 1.62 ERA over his previous eight appearances since going back to the bullpen June 3. ... Green has 400 career doubles. ... Saarloos is 0-3 with a 4.50 ERA in 10 appearances at night this year. ... Melhuse ended an 0-for-14 stretch and Ellis an 0-for-12 funk.