Steve Pearce singles in the sixth inning to drive home a run in Baltimore’s 5-1 win over the Pirates on Thursday in the first game of a doubleheader. Pearce had three hits and drove in two runs. (Patrick Semansky/Associated Press)

— And on the fourth day, the Orioles played. And won.

They won, watched it rain, and then they won again at nearly 1 a.m. with a walkoff homer by Matt Wieters in the 10th inning.

After a scheduled day off Monday, followed by consecutive rainouts Tuesday and Wednesday — the first time they've been postponed consecutively since 2004, and the first time it has happened at Camden Yards since 2000 — the Orioles and the Pittsburgh Pirates finally played on what was supposed to be a mutual day off Thursday.

They actually rolled the festivities into Friday morning, playing two games and a total of 19 innings — with the Orioles winning the first game, 5-1, and the second, 6-5, in 10 innings before an announced 28,290.

Wieters homered over the right-field scoreboard on the second pitch from Pirates reliever Stolmy Pimentel to end the baseball marathon at 12:53 a.m. Friday morning.

Tommy Hunter (1-0) was credited with the win in the nightcap after getting the save in the first game.

There were plenty of weird twists in the doubleheader that began at 4:08 p.m., didn't finish until nearly 1 a.m., and included a 21-minute rain delay in the middle of the first game and a 46-minute delay before the first pitch of the second.

Thursday marked the season debut of third baseman Manny Machado, who battled back from offseason knee surgery to ground out four times and pop up once in five at-bats in the second game.

It doubled as the season debut of left-hander Troy Patton, who is back after serving his 25-game suspension for testing positive for amphetamines. He retired one of the three batters he faced.

It signaled the triumphant Orioles return of first baseman Steve Pearce, who was released Sunday, re-signed Tuesday, hit three singles and drove in two runs to lead the way in the early victory Thursday.

It featured one of the strangest starts in recent memory by ace Chris Tillman, who threw 49 pitches in the first inning of the second game, escaped after allowing two runs and ultimately received a no-decision in a season-low 4 2 / 3 innings.

It included a two-homer night by right fielder Nick Markakis — one in each game — after he failed to hit one previously this season.

It also put an exclamation point on what has been a crazy month-plus of scheduling for the Orioles that has included a spate of consecutive day games, fluctuating start times and weather challenges.

“I think, for the entire roster, it's not easy to put into words,” said Orioles right-hander Bud Norris, who picked up the win in the first game. “It does show the testament of our club and how we are going to strap it on … It says a lot about the culture [of the club] and everything else. I knew today was going to be tough after the last two days with the rain.”

In the end, the Orioles improve to 15-13 while the Pirates (10-18) have dropped 15 of 19.

The second game didn't begin well for the Orioles as Tillman, who was coming off an outing last week in which he allowed seven runs, gave up two in the first inning Thursday night. He allowed two hits and three walks, including two with the bases loaded.

It was the first time an Orioles pitcher had thrown as many as 49 pitches in an inning since Tillman did it in the first in a 19-7 loss at the Minnesota Twins on July 16, 2012. He lasted just two-thirds of an inning in that game. On Thursday, he survived the first and ultimately gave up three runs in a season-low 4 2 / 3 innings while throwing 112 pitches.

His 49-pitch first including a mind-numbing 16 foul balls by a Pirates team that simply couldn't get the big hit. They left 27 runners on base in the doubleheader.

The Orioles bullpen, which threw 3 2 / 3 scoreless innings in the first game, gave up two runs in 5 1 / 3 innings in the nightcap. Evan Meek allowed one run in one inning pitched and Patton was charged with one run in one-third of an inning after Ryan Webb allowed an inherited runner to score on a single. Webb, however, got out of the no-outs, two-runners jam by retiring the next three batters.

The Orioles scored four times in the sixth with two outs. Adam Jones doubled home a run, Wieters added an RBI single and J.J. Hardy smacked a two-run single to tie the game. Pearce, running from second, scored on the play when catcher Chris Stewart couldn't hold onto the ball on the tag. Markakis' second homer of the day tied it again at 5-5 in the seventh.

In the first game, the Orioles' offense was paced by the club's poster boy for waiting things out: Pearce, who hadn't played a major league game since April 13. The 17-day layoff didn't seem to bother him.

After going 1-for-7 before being released and re-signed this week, Pearce singled in his first three at-bats against the Pirates, the club that originally drafted him. It was Pearce's first three-hit game since June 9 and his two RBIs in the game were his first two of the season.

“Stevie gave us a real lift. Made a couple nice plays at first, too. Stevie was a big contributor,” Orioles manager Buck Showalter said after Game 1. “Great example of players having an opportunity of deciding where they want to play. He wants to play. We're thankful that he did.”

It was a moment Pearce had been waiting for patiently — for more than a week, if not all season. He was taken off the roster April 22 and was in limbo until re-signing with the Orioles on Tuesday to, essentially, play first base until Chris Davis comes off the disabled list. Pearce had been claimed by the Toronto Blue Jays on Tuesday, but he rejected the claim to re-join the Orioles.

“I don't know if you'll ever see it again. Maybe in Baltimore,” Showalter said of the strange odyssey taken by Pearce this week. “They like playing with each other. It's a testament to the culture those guys have created for each other.”

Pearce had singled in his first at-bat in the third, but there was more at stake in the fifth. And he succeeded, knocking Morton's 92-mph sinker into left to tie the game. Ryan Flaherty followed with a two-run single, also to left, for a three-run fifth — that ultimately was enough scoring.

“It says that [Pearce] knows how to hit. It says that he is a competitor. He has been through this process before and the transactions and everything else,” said Norris, who improved to 2-2 with the win in the first game. “It just gives him the capability to go out and play. He knows that he wants to be here, as we all can see. And it was just really good to see him have three hits and the RBIs. And I'm sure he is smiling right now.”

— Baltimore Sun