OAKLAND, Calif. -- Maybe a game-winning, broken-bat hit against baseball's career saves leader in the 18th inning will get Nate Freiman in a nice groove again.
"It was his deal," Freiman said of the cut fastball he saw. "That one he always throws."
As a day game after a night game turned into a night game after a day game, John Jaso singled off Preston Claiborne (0-1) to start the decisive rally and went to third on Seth Smith's soft single to shallow left field against Rivera.
Rivera issued only the 39th intentional walk of his 19-year career to Jed Lowrie before Freiman ended the 5-hour, 35-minute game on New York's getaway day to Anaheim for a weekend series with the Angels.
"A little broken-bat blooper over the third baseman, and the other one the same place," Rivera said. "You can't do anything about it."
Freiman knew he had it, raising his right arm in triumph.
"I knew that was not getting to the left fielder. I knew it was falling," he said.
Moments later, Freiman received a celebratory whipped cream pie in the face following his first career game-ending hit -- and Oakland's fifth of 2013 after compiling a major league-best 14 walk-off wins last year. He had entered the game in the top of the 16th.
The AL West-leading A's (41-27) won their 11th in a row at home, 21st in 26 overall, and moved a season-best 14 games above .500 to extend their best start since 1990. They became the first American League team to play two 18-inning games in one season since Oakland and the Washington Senators did so in 1971.
Freiman's wife, LPGA golfer Amanda Blumenherst, quickly congratulated her husband on Twitter: "Ahhh!! Nate just ended the 18 inning game! Bases loaded, single!! Pie in the face! Athletics win!"
Each team used seven pitchers and threw 255 pitches. In all, 137 batters came to the plate -- short of the season high of 156 during Oakland's 19-inning win over the Angels in April and also the 20-inning game between the Marlins and Mets on Saturday.
"It was very taxing even winning the game. To lose could have been demoralizing," A's manager Bob Melvin said. "These are awful games to lose."
New York made a dramatic play in the bottom of the 15th to keep the game going.
Pinch hitter Coco Crisp singled to left with one out and Vernon Wells made a perfect throw to catcher Chris Stewart, who blocked the plate and absorbed a collision to prevent Brandon Moss from scoring the winning run.
The A's had already begun streaming out of the dugout to celebrate.
The Yankees had runners in scoring position in each of the extra innings through 14, stranding 11 baserunners. They left 13 on base in all while dropping their seventh in a row at the Oakland Coliseum.
Pitching for the first time in eight days, Jesse Chavez (1-0) struck out seven in 5 2/3 scoreless innings.
Robinson Cano hit a two-run homer in the first as New York ended a season-long five-game stretch without a long ball, but the Yankees didn't score again on another day of missed opportunities.
"I think it's probably a little more frustrating because you can look at how you had an opportunity here and an opportunity there," Yankees manager Joe Girardi said. "A lot of guys probably look at that, but it doesn't change the result."
It was the longest day game in Coliseum history.
After Smith's tying, two-out double in the third, Oakland didn't reach base again until Jaso's bloop single leading off the ninth.
Oakland won the season series 5-1 for its second-best mark against the Yankees in franchise history. The 1990 club went 12-0.
The A's tied it at 2-2 in the third on a close play at the plate. Smith doubled off the wall in right and the relay throw was on target to Stewart, who tagged Jaso with his glove but had the ball in his bare hand.
Jaso was called safe by plate umpire CB Bucknor, drawing an argument from Girardi.
Parker, riding a three-start winning streak, was helped by a pair of double plays in the first four innings.
Girardi bumped Jayson Nix up to the No. 2 spot in the batting order from eighth a night earlier to shake things up and get the Yankees going, but Nix went 1 for 5 with a strikeout to end the 12th.
Yankees captain Derek Jeter had his surgically repaired left ankle examined by Dr. Robert Anderson in Charlotte, N.C., and was cleared to resume baseball activities and running. ... Crisp (bruised heel) and LF Yoenis Cespedes (tight left hamstring) were held out of the starting lineup. ... Rivera received a surfboard and a bottle of white wine from Napa Valley from the A's in a pregame ceremony, along with a $10,042 donation to his foundation. ... The A's are 7-0-2 in their last nine series. ... New York agreed to contract terms with Notre Dame 3B Eric Jagielo, who signed for $1,839,400. He was the 26th overall pick in last week's draft and one of three first-round selections by the Yankees.