San Francisco Giants pitcher Johnny Cueto carried a no-hitter into the bottom of the sixth inning against the Los Angeles Dodgers on Saturday night when a touch of bad luck struck the team.

Dodgers batter Kike Hernandez hit a fly ball to left field and it appeared Hunter Pence was going to make the easy out. But the veteran outfielder lost the ball in the lights, allowing the ball to drop several feet behind him.

BREWERS' CHRISTIAN YELICH HITS 'THE LUCKIEST HOME RUN IN BASEBALL HISTORY' VS. WHITE SOX

The miscue ended Cueto's no-hit bid. He would record two more outs and get taken out of the game after allowing the Dodgers to score some runs.

“Johnny had the magic and everything working. To spoil that feels absolutely awful. He deserves better,” Pence said after the game.

NICK MARKAKIS RETURNS TO BRAVES IN DRAMATIC FASHION WEEKS AFTER CHOOSING TO OPT OUT OF 2020 SEASON

Cueto allowed four earned runs on two hits with three strikeouts in 5 2/3 innings. He gave up a three-run homer to Justin Turner.

“All my pitches were working fine, and I felt comfortable,” Cueto said. “I think the most frustrating thing was the ball that was lost. If that is caught the game changes and maybe I pitch out of the inning. I didn’t throw a lot of pitches. It's hard to tell how far I could have gone.”

CLICK HERE FOR MORE SPORTS COVERAGE ON FOXNEWS.COM

San Francisco held on to win 5-4. Austin Slater hit two home runs and Mike Yastrzemski also went the distance for the Giants.

The Associated Press contributed to this report.