Joe Girardi said the idea struck him in the eighth inning, and even then, he wasn’t sure it would be allowed. Can one player remove another player from the game? What about two players? What if one of them is on the disabled list? Girardi had to check with the umpires. He had to notify the players. He had to hatch a scheme to produce the most memorable moment of this season.

“My first thought was, ‘Ahh, I don’t know,’” Andy Pettitte said. “‘That might be a little weird.’ Then everybody on the bench, all the guys, were like, ‘You’ve got to do it.’ I’m so glad we did. … I didn’t say anything (on the mound) at first. I didn’t expect for him to be quite so emotional. He broke down and just gave me a bear hug, and I just bear-hugged him back. He was really crying. He was weeping. I could feel him crying on me. I think I was just telling him, ‘Man, you’ve been so awesome to play with.’ Just sharing stuff with him that I’ve already told him and he knows. Just telling him that I appreciate it and I love him. It’s just been an honor to play alongside him. That was what I was trying to say to him.”

Rivera was sobbing into Pettitte’s shoulder, the game’s most unshakable closer finally overwhelmed by the moment. He’d entered to the sound of Bob Sheppard’s voice and Metallica’s guitars. He’d pitched through the flashing of cameras and — it turned out — the flashes of a 19-year career.

“During the ninth inning, the first few pitches, I couldn’t control (them),” Rivera said. “I was bombarded with emotions and feelings that I couldn’t describe. Everything hit at that time. I knew that that was the last time, period. I never felt something like that before.”

Rivera said he wasn’t expecting it. Not like this. He got through the eighth inning — stranded the runners, of course — and when he went into the dugout, he disappeared into the trainers’ room to get a heat pack on his arm. He was really searching for more time, more space. Girardi said Rivera always sits in the dugout when he’s pitching multiple innings. He never walks away like that.

“I had to regain my composure,” Rivera said. “I was trying to put some warm on my arm and everything started hitting me from there: All the flashbacks from the minor leagues to the big leagues, all the way to this moment.”

Back for the ninth, the first out was a comebacker to the mound. The second was a popup to second. Pettitte and Jeter had let Rivera in on the plan between innings, so what came next didn’t necessarily catch anyone off guard. But Pettitte signaled to the bullpen — “The guys said that I looked pretty official when I was calling for the right-hander,” Pettitte said — and then went to take the ball. That’s when Rivera broke down.

“I felt like he didn’t want to let go, so I just kept hugging him,” Pettitte said. “I just stayed with it. I was going to go as long as he wanted to stay out there. … I think I was telling Jeet the other day, all you’ve got to do is mention their name and that’s kind of where I feel like I get emotional. It all is going through my head, everything that we’ve done, we’ve been through. It’s all been so special. It’s crazy how fast it went by.”

Off the mound, still with tears on his face, Rivera saluted the crowd, hugged his manager, hugged his teammates, and went back for a curtain call. Girardi was crying on the field, and he broke down several times during a postgame press conference.

“For me, probably the best way to put it is I (always) loved to see him come into the game,” Girardi said. “As a player, it was fun. As a manager, it was easy. It’s not hard to pick up that phone and decide who you want when Mo’s down there. … But probably more important than that, he made all our lives better.”

When it was over, Rivera sat in the dugout for several minutes. When he stood, it wasn’t to walk into the clubhouse, it was to walk back to the mound where he kicked at the rubber before kneeling the ground and scooping dirt into his hand.

“I won’t call it magical, I would call it blessed,” Rivera said. “I’ve had an opportunity to play for 19 years and give the best of my talents and my ability to this organization. Tonight, it paid off. The fans, they definitely appreciate that. My family, my wife, my kids, the whole fans. It was amazing. A great night. We lost, so I don’t know how I’m saying that, but it was a great night.”