BOSTON -- Chris Davis had a much better day as a designated pitcher than as a designated hitter.

In the first major league game since 1925 in which both teams put a position player on the mound, Davis overcame an awful day at the plate by pitching two scoreless innings and getting the win as the Baltimore Orioles outlasted Boston 9-6 Sunday in 17 innings.

Davis went 0 for 8 as the DH, striking out five times and grounding into a double play. Yet in a season full of surprises for the Orioles, the first baseman by trade delivered the biggest one yet in his pro pitching debut.

"I was like 'Sweet! I get to try something different today -- because hitting ain't working,' " Davis said. "Basically, that was my first thought."

Adam Jones hit a three-run homer in the top of the 17th off Darnell McDonald, an outfielder the Red Sox turned to once their bullpen was empty.

Boston then got two runners on to start the 17th against Davis (1-0). With a fastball in the mid 80s mph, he struck out All-Star slugger Adrian Gonzalez and got McDonald to ground into a double play to end a game that took 6 hours, 7 minutes.

The last time two teams brought in position players to pitch in the same game was Oct. 4, 1925, when Hall of Famers Ty Cobb of Detroit and George Sisler of the St. Louis Browns closed out the second game of a doubleheader on the last day of the season, STATS LLC said.

The last time any position player wound up as the winning pitcher was May 25, 2011, when Philadelphia infielder Wilson Valdez threw one scoreless inning in a 19-inning victory over Cincinnati.

"I was just out there trying to throw strikes and not blow the game," Davis said. "In a game like that when everybody's battling, trying to get a win, both teams are throwing everything they got at each other. You don't want to blow it."

Baltimore and Boston each used eight pitchers before going to Davis and McDonald.

"Just when you think you've seen it all, some days you come out here and just assume the position. That was fun," Baltimore manager Buck Showalter said. "It was a long day, but you like to get something good out of it."