After a long day and night of baseball Thursday at Camden Yards, Matt Wieters brought the action to abrupt halt early Friday morning.

The Orioles catcher led off with the bottom of the 10th inning with a home run off Stolmy Pimentel, giving Baltimore a 6-5 victory over the Pittsburgh Pirates and a doubleheader sweep.

Pimentel (2-1) was facing his first batter when Wieters lined a 1-0 pitch down the right field line for the walk-off homer just before 1 a.m. EDT.

"It was long for me, and I only played half of it," Wieters joked about the doubleheader. "It's nice to get a win, it's nice to be able to get a team win where we had to battle back and come back and score some runs."

Baltimore closer Tommy Hunter (1-0) got the victory in the nightcap after earning a save in the first game, which the Orioles won 5-1.

In fact, Hunter was one of four Orioles pitchers who came into both games. Ryan Webb, Brian Matusz and Darren O'Day also made two appearances, and manager Buck Showalter complimented his bullpen, especially those who doubled up.

"I'm real proud of everybody," Showalter said. "The bullpen was outstanding in both games. There were a lot of big outs pitched."

The Orioles (14-12) needed help in the second game after starter Chris Tillman struggled through 4 2/3 innings. He needed 49 pitches to get through the first inning and eventually threw 112, leaving with Baltimore trailing 3-0.

"After that first inning, it was tough, but I still had a job to do," Tillman said. "I can't think about that (inning)."

Tillman gave up bases-loaded walks to second baseman Neil Walker and left fielder Starling Marte in the first for a 2-0 Pittsburgh lead. The Pirates added a run in the fifth on a triple by first baseman Gaby Sanchez that knocked out Tillman.

Sanchez had a single, a double and a triple while going 4-for-6 in the second game.

Pirates designated hitter Ike Davis lined an RBI single to left to give his team a 4-0 lead in the top of the sixth before Baltimore woke up.

Center fielder Adam Jones lined an RBI double to right off right-hander Brandon Cumpton with two outs. Wieters followed with a run-scoring single, and he moved to third on Pearce's double to right. Bryan Morris then came on to pitch, and shortstop J.J. Hardy greeted him with a game-tying, two-run single.

Marte's RBI single gave the Pirates a brief 5-4 lead in the seventh before Baltimore right fielder Nick Markakis tied with it a solo homer in the bottom half, which set up the late-inning dramatics for the Orioles.

Baltimore third baseman Manny Machado returned for the Thursday night game after spending the first month on the disabled list following offseason knee surgery. The 21-year-old drew a standing ovation from the Baltimore crowd on his first at-bat.

Machado finished 0-for-5, a bit of bad news in an otherwise uplifting day for the Orioles. The Pirates, meanwhile, dealt with lots of frustration. They left 15 on base in the second game after stranding 13 in the opener.

"We're getting the hits," Davis said. "We're hitting the ball hard but they're getting caught. If we score five (runs) and (have) nine (hits), we feel like we're going to win here."

Pittsburgh manager Clint Hurdle said he liked how his team is trying to battle its way out of its early-season offensive problems. A big hit or two could have gone a long way Thursday.

"We keep fighting and fighting and putting ourselves in scoring position, but we haven't been able to cash in the way we need to," Hurdle said. "We keep showing up. The bats were better throughout the series. We had men on base throughout the game. We're still looking for that big hit."

NOTES: RHP Chris Tillman was the last Orioles pitcher to throw 49 or more pitches in an inning before he did so again Thursday night. According to the Elias Sporsts Bureau, he had a 49-pitch inning July 16, 2012, at Minnesota during a 19-7 loss in which he lasted just two-thirds of an inning -- his shortest start ever. ... Orioles DH Nelson Cruz finished April with 24 RBIs in 22 games. It was the first time he knocked in more than 20 runs in April. ... Pirates RF Travis Snider batted leadoff for the first time this season in the nightcap. He went 0-for-5 with a walk.