OAKLAND, Calif. — This marked a small victory for the last-place Athletics: They nearly got no-hit for the first time in 2 1/2 decades, yet still held the mighty Boston Red Sox scoreless in their last matchup of the season after allowing 67 runs over the first five meetings.

Oh, and Oakland won 1-0.

Eduardo Rodriguez’s no-hit bid for Boston got broken up after a replay reversal with two outs in the eighth inning Sunday, and Khris Davis hit a game-ending double in the ninth that helped the A’s snap a five-game losing streak overall and nine-game skid to the Red Sox.

Oakland starter Kendall Graveman struck out seven in 6 1/3 sharp innings.

“You know they’re going to put some good swings on you and today a couple of balls were hit hard right at people, and that helped us,” he said.

In the ninth, Brock Holt misplayed Davis’ double in deep left field for an error that allowed Danny Valencia to score from first base. Valencia drew a leadoff walk against Craig Kimbrel (2-4), and Oakland averted a three-game sweep.

Semien reached on an infield single in the eighth after Rodriguez stuck out his right leg to knock down a grounder. The left-hander located the ball on the mound, scooped it up and threw to first, where Semien initially was ruled out by umpire Laz Diaz.

A’s manager Bob Melvin challenged the call, which was overturned after a replay review that took approximately 19 seconds. Replays clearly showed Semien was safe, just as Rodriguez knew they would.

Rodriguez got the final out of the inning, keeping the game scoreless. But after that, his day was done.

“He was outstanding and unfortunately he gets a ball off his shoe that he can’t seemingly find, and that’s the end of a potentially history-making day here,” Boston manager John Farrell said.

Jon Lester tossed the most recent no-hitter for the Red Sox on May 19, 2008, against Kansas City.

Boston right-hander Rick Porcello carried a bid for a perfect game into the sixth inning of an 11-2 victory Saturday. Jake Smolinski broke that one up with a double.

Oakland has not been held without a hit since four Orioles pitchers turned the trick on July 13, 1991 — the longest active streak in the majors.

Ryan Madson (5-4) pitched the ninth for the win.

Retiring Red Sox slugger David Ortiz received a standing ovation before his initial at-bat, when he struck out swinging to end the first.

He went 0 for 2 with two strikeouts and two walks after going 5 for 6 with five RBIs in the first two games of the series.

“It’d be nice if he took a day off,” Melvin joked before the game. “He’s performing as well as he ever has.”

After Boston outscored Oakland 27-4 over the previous two games, neither team could capitalize Sunday until the very end.

The Red Sox had put up at least 11 runs in all five previous meetings this year, including 16 in Friday’s series opener.

Oakland’s first win in six tries against the Red Sox meant the A’s avoided going winless for the fourth time against an AL team in one season. They went 0-11 against Baltimore in 1978, 0-7 versus Cleveland in 1995 and 0-6 when facing the Indians in 1994.

Davis appreciated Graveman hanging tough for everybody.

“Early in the game I was a little frustrated with the umpires and he showed some leadership by just letting me know that he needs me out there,” Davis said. “And that showed up late in the game, so give him credit.”

Dustin Pedroia has an 11-game hitting streak and has hit in 20 straight against the A’s.

MONCADA’S FIRSTS

Cuban star Yoan Moncada made his major league debut Friday for Boston, got his first hit and RBI with a run-scoring double Saturday, then was picked off and committed an error at third base Sunday.

His glove came through when it mattered behind Rodriguez: Moncada snagged Billy Butler’s hard liner to start the seventh.

TRAINER’S ROOM

Athletics: Rehabbing pitchers Felix Doubront (left elbow) and Chris Bassitt (right elbow) were scheduled to play catch out to 90 feet Monday as they each recover from Tommy John surgery.

UP NEXT

Athletics RHP Raul Alcantara will make his major league debut Monday against the visiting Los Angeles Angels.