LOS ANGELES (AP)With runners reaching on an error, a walk and a hit batter, Tyler Anderson wasn’t aware he was working on a no-hitter.

Once the 32-year-old Los Angeles Dodgers left-hander reached 99 pitches after the seventh inning Wednesday night, even pitching coach Mark Prior told Anderson he didn’t think he’d finish it off.

Anderson lost his no-hit bid in the ninth, giving up a one-out triple to Shohei Ohtani in a 4-1 victory over the Los Angeles Angels.

”The number went by the wayside after the eighth inning,” manager Dave Roberts said. ”Just watching his stuff, there wasn’t much of a falloff. There was still command in there, there was still teeth to the breaking pitches. I was just really wanting that for him.”

Anderson (8-0) threw a career-high 123 pitches, 78 for strikes. He struck out eight and walked two in lowering his ERA to 2.82. He was pulled after Ohtani sent a line drive into right field that easily eluded a diving Mookie Betts.

”You can’t ask for anything better than that,” Anderson said of Betts’ effort. ”I kind of laughed that he dove for it. It’s a very nice gesture.”

Anderson walked off to a standing ovation from the crowd of 50,812 and tipped his cap. He struck out three-time MVP Mike Trout to open the ninth before Ohtani laced his first triple of the season. Anderson fanned the reigning AL MVP in his first two plate appearances.

”It felt like a really big spot in a playoff situation,” Anderson said about the ninth inning. ”The crowd was really, really into it. You can feel the energy.”

Anderson appreciated Roberts’ faith. His previous career high was 109 pitches in 2018 with Colorado.

”You may never have a chance to do that again,” said Anderson, who has endured injuries throughout his seven-year career with five different teams. ”You just want to give it a chance.”

Roberts lifted Anderson after Ohtani’s triple. Craig Kimbrel came on in relief and gave up an RBI single to Matt Duffy before closing it out.

Roberts has typically erred on the side of caution and pulled pitchers from perfect games and no-hitters. Most recently he did so with Clayton Kershaw on April 13. The three-time Cy Young Award winner was perfect through seven innings, but he got the hook after 80 pitches because it was his first start of the season after an abbreviated spring training.

”I know I’ve got this reputation as the grim reaper, but I’m a sports fan, too,” Roberts said, ”and I really felt I wanted that just as much as Tyler and his teammates wanted that for him.”

Once Anderson got through the eighth, Roberts decided to let him try to finish it.

”I didn’t feel in this moment his health was compromised at all,” Roberts said.

Anderson’s near miss came one night after St. Louis Cardinals starter Miles Mikolas got within one strike of a no-hitter against Pittsburgh. Cal Mitchell doubled on a 2-2 pitch with two outs in the ninth inning for the Pirates.

The Dodgers backed Anderson early. Will Smith hit a three-run homer in the first and Trea Turner added a solo shot in the third.

Anderson got some inadvertent help from the official scorer, who changed Taylor Ward’s hit in the first to a fielding error by center fielder Cody Bellinger. In the seventh, Anderson was charged with a throwing error that put Jared Walsh on first.

”Nine times out of 10 I make that play,” Anderson said.

The Dodgers took both games of the Freeway Series for their sixth series sweep of the season. The skidding Angels lost their 11th in a row on the road and have dropped 18 of 20 overall.

Angels rookie Reid Detmers (2-3), who pitched a no-hitter against Tampa Bay last month, gave up four runs and four hits in 3 2/3 innings. The left-hander struck out a season-high six and walked three.

TRAINER’S ROOM

Angels: 3B Anthony Rendon was out of the lineup after reaggravating his right wrist.

Dodgers: LHP Andrew Heaney (shoulder) could start Sunday against Cleveland. He was on his way back to LA from his third rehab start for Double-A Tulsa. … RHP Blake Treinen (shoulder) is advancing in his throwing program.

UP NEXT

Angels: Ohtani (4-4, 3.64 ERA) pitches Thursday at Seattle in the opener of a four-game series. He’s 2-0 with a 2.37 ERA in three career starts against the Mariners. He’s allowed two or fewer runs in seven of his 10 starts this season.

Dodgers: LHP Julio Urias (3-6, 2.80) starts Friday against Cleveland in the opener of a three-game interleague series. He’s gone four straight starts without a win despite allowing just eight runs in his last 23 1/3 innings.

More AP MLB coverage: https://apnews.com/hub/MLB and https://twitter.com/AP-Sports