ARLINGTON, Texas — Yu Darvish thought he had given up a hit when Boston slugger David Ortiz made contact.

The Texas Rangers ace was talking about the popup in the seventh that was ruled an error without being touched. Not the clean single by Ortiz through the shifted infield with two outs in the ninth that did break up the no-hitter in the Rangers' 8-0 victory Friday night.

"Obviously I was a little disappointed, but I was already ready to give up a hit, so it didn't really matter," Darvish said through his interpreter about the error that led to Boston's first runner. "But I was getting tired, so I thought it could have been a hit so I don't have to pitch that many more innings."

It was another near-miss for Darvish, who came within one out of a perfect game last season against Houston before Marwin Gonzalez singled through his legs.

"If I keep pitching like this, someday I'll get it," Darvish said. "Someday, I'll just keep doing what I'm doing and I'll probably have another record of almost a no-hitter."

Darvish (3-1) struck out 12, including six Red Sox in a row at one point, and walked two. It was his 21st career game with at least 10 strikeouts, the most in the majors since his debut in 2012 after coming from Japan.

"He had great stuff. He was locating everything," Red Sox second baseman Dustin Pedroia said. "He was on his game. When a guy like that, with that kind of stuff, is on his game, it makes it a tough night."

Rookie second baseman Rougned Odor, positioned in shallow right field, made a diving attempt at Ortiz's hit but the ball was out of reach. If the Rangers had not shifted their infield toward the right side of the diamond — a standard practice against the pull-happy Ortiz — it probably would have been a routine grounder to second.

Darvish bent his knees and put his glove on his hips after the base hit. Texas manager Ron Washington then made a slow walk to the mound, with the 45,392 in attendance cheering and chanting "Yuuuuuu!"

Alexi Ogando got out Mike Napoli to wrap up the Rangers' second consecutive shutout since giving up 29 runs in three games to Colorado.

The closest Boston had come to a hit before then was the high popup to right by Ortiz with two outs in the seventh.

Odor was also shifted into shallow right then and drifted back for the ball while right fielder Alex Rios came in before suddenly stopping. Odor, the 20-year-old playing in his second major league game, then lunged with his glove extended above his head but the ball dropped between them. Darvish then walked Napoli.

An error was charged to Rios after official scorer Steve Weller looked at replays and conferred with several others because of the significance of the play.

"I should have taken control of that ball," Rios said. "We were camped under the ball, so it can be called an error."

Weller, in his 20th season as a scorer, told a pool reporter after the game that it was a judgment call and "I felt like the second baseman or right fielder under normal effort could've clearly caught the ball."

Once the no-hitter was over, Ortiz thought he should have also been credited with a second hit for the ball in the seventh that even he acknowledged should have been caught. He would have been OK with the error had he not gotten the hit in the ninth.

"Guy's throwing a no-hitter. We all understand that. But when it comes down to the rules in the game, that's a hit," Ortiz said. "That's the rule that we all know, and that's the rule that the game (has had) for more than 100 years. The ball in the outfield drops in between infield and outfield, nobody touched it. ... So I guess it's going to be two (hits) now."

Clay Buchholz (2-3) allowed six runs and 10 hits over 4 1-3 innings. He struck out three and walked two while throwing 96 pitches.

Darvish walked another batter in the eighth but went into the ninth looking for the first no-hitter in the majors this season. Pedroia grounded out and Shane Victorino struck out before Ortiz stepped to the plate.

"You know that if you don't break up the no-hitter you're showing up and I'm going to be on ESPN for about a month," Ortiz said. " That was the only pitch he gave me to hit, basically."

NOTES: Elvis Andrus had four hits and scored three runs for Texas. ... Darvish was winless in his previous nine home starts despite a 2.83 ERA. He had not won at home since Aug. 1 against Arizona. ... The last no-hitter for the Rangers was Kenny Rogers' perfect game against the California Angels on July 28, 1994. ... Boston last went without a hit on April 22, 1993, against Seattle's Chris Bosio. ... The Rangers lead the majors with eight shutouts.