LOS ANGELES — As Matt Moore’s 133rd pitch of the night dropped softly into shallow right field, Bruce Bochy quickly went up three dugout steps and headed for the mound. Moore turned and saw him, and then he turned another way and saw his catcher approaching. 

Moore rubbed up a new ball he would never get to throw, a ball that was inches from staying in an umpire’s pocket as the Giants celebrated. He held up his glove hand and gave Buster Posey a fist bump, and then he did something remarkable given the disappointment of the moment. He smiled.

On the biggest night of the season, Moore came one out away from becoming the first Giant in 101 years to no-hit the Dodgers. His pitch count, far and away a career-high, kept him from a complete game. Nothing would keep him from a 4-0 win over the Dodgers.

“I’m happy,” he said half an hour later, again flashing a wide grin. “You never want to get swept.”

That’s especially true here, and especially now. The worst team in the Majors in the second half was in danger of getting swept by a bitter rival and falling four games out of first. Moore, in his fifth start as a Giant, changed all that. Yes, the Giants still lost the series and dropped a little more ground in the standings. But after Moore’s brilliant performance, it sure didn’t seem that way.

“It doesn’t feel like we lost the series, to be honest,” center fielder Denard Span said. “Not after a win like tonight’s.”

[WATCH: Moore: 'Hopefully [near no-hitter] ... can spark something']

If the Giants go on to catch the Dodgers and win the National League West, this will be the night they point to. If they recover from this six-week stretch of baseball hell and win a fourth title, this will be the night that was the starting point. No matter what happens down the stretch, though, this will always be remembered as the night Moore, acquired in a deal that sent popular third baseman Matt Duffy to Tampa Bay, earned his orange-and-black stripes. 

“This game is probably as big a game as any game we’ve had all year,” Bochy said. “We had to win.”

That part was locked up relatively early. With the way Moore was pitching, a one-run lead was enough. The Giants gave him four, with Joe Panik providing the big blow on a two-run homer to right. There seemed little chance the Dodgers would recover from that, not on such an emotional day at Dodger Stadium. A few hours before first pitch, the Dodgers announced that they had traded clubhouse leader A.J. Ellis to Philadelphia. It was a body blow and players readily admitted it. Moore took advantage.

The left-hander had started mixing in a cutter in his previous start, and on Thursday he threw 23 of them. Span noticed the change from center field, calling the pitch “the equalizer.” After mostly being a fastball-curveball guy in his first three starts with the Giants, Moore had an almost equal distribution with his cutter, curveball and changeup. 

“He was throwing the ball to both sides of the plate with four different pitches,” Posey said. 

Yasmani Grandal’s second-inning walk represented the only baserunner through six innings, but Moore’s pitch count was creeping into a dangerous territory. He was at 95 by the end of a strenuous seventh, and after a four-pitch walk to Grandal to open the eighth, Sergio Romo and Javier Lopez started warming up. Chase Utley’s 10-pitch strikeout only inflamed the problem, and when Moore returned to the dugout, Bochy was waiting. 

Moore had thrown 119 pitches at that point, five more than his previous high since returning from having Tommy John surgery in 2014. His previous career-high was 120.

“Listen,” Bochy told him. “I know what a great opportunity you have here …”

“I’m telling you, I couldn’t feel better,” Moore responded. 

Bochy decided to give Moore the ninth with the caveat that one more walk would end his night. “It’s hard to deny a veteran who has a chance to make history,” said a manager who once let Tim Lincecum throw 148 pitches in a no-hitter.

Moore sprinted to the mound at the start of the ninth, waiting for Trevor Brown to jog out and warm him up. He said his arm felt as good then as it had in the third. Later, he was asked about the state of his surgically-repaired elbow and he said the thing he’s most looking forward to is the end of questions about the state of his elbow. 

“They used to not even count pitches, right?” Moore said, seemingly quoting the Book of Bumgarner. “I appreciate the skip taking my word for it there.”

Moore’s bid very nearly ended at the start of the ninth. Enrique Hernandez smoked a liner to left-center that looked like such a sure hit that Bochy started heading toward the mound. Earlier, Brandon Crawford and Span had made highlight plays to help Moore. This time, Span was there again, making a sliding catch in the gap. Moore smiled and waved at Span, yelling, “Atta boy, Denard!”

“It was like playing the game when you were a little kid,” Moore said. “You’re holding your breath until you see him squeeze it.”

Span had previously been a part of one no-hitter and been on the wrong end of one. When he got up, he immediately thought of DeWayne Wise, the White Sox outfielder who saved Mark Buehrle’s perfect game in 2009.

“It seems every no-hitter has a play where someone does something remarkable,” Span said. “As soon as I caught that, I thought for sure he would get it.”

Moore needed seven pitches to get a Howie Kendrick groundout and then went 1-1 to Corey Seager, the rookie shortstop who may win the MVP award when all is said and done. Seager was celebrating a bobblehead night, and he brought a crowd of 53,297 to life by blooping an inside fastball into shallow right. Gorkys Hernandez had replaced Hunter Pence, who again has hamstring tightness, and he couldn’t get close enough for a diving effort. Moore said it was the pitch he wanted to make.

“It was a fun ride all the way to that point,” he said. “I feel I executed the pitch.”

Posey agreed. “It’s one of those that finds some grass,” he said.

Moore gave way to Santiago Casilla, who got the final out with one pitch. The team crept a game closer to first and Moore picked up his first win as a Giant. He said he was happy with the way it all turned out, noting that it’s a team sport and his team needed a win, not a no-hitter.

Still, he almost gave them both, coming up just short of a historic feat.

Moore hasn’t even been a Giant for a month, so he doesn’t quite know the history of no-hitters and perfect games and Buster Hugs. As he finished a lengthy session with reporters, he was told that the Giants nearly became the first team in MLB history to throw a no-hitter in five consecutive seasons. 

Moore slapped a hallway wall, feigning anger. But he couldn’t hold it. He smiled again, and walked away.