Aroldis Chapman of the New York Yankees stands on the...

Aroldis Chapman of the New York Yankees stands on the mound during the 11th inning against the Seattle Mariners at Yankee Stadium on Friday, Aug. 25, 2017. Credit: Jim McIsaac

For nearly three weeks, Joe Girardi had been waiting for an excuse to return Aroldis Chapman to the closer’s role.

And as soon as Dellin Betances gave him one, by hanging a curveball that Manny Machado bashed for a walk-off homer in Tuesday’s crushing 7-6 loss to the Orioles, Girardi didn’t hesitate to say Chapman was ready for reinstatement, if only on a trial basis.

Shortly after revealing that Wednesday’s game had been postponed because of rain, Girardi gushed that he “probably” would have used Chapman to close Wednesday night, an indication that his probation period was coming to a close.

“I really believed he would get back on track,” Girardi said.

It took some time, but letting Chapman get another shot at saving games is definitely the right call. The Yankees must have felt queasy about using an $86-million pitcher in middle relief — it was like staring at a broken-down BMW collecting rust in your driveway — and the front office had to be getting itchy about reinstalling Chapman as closer again.

They couldn’t force the issue, however. Not with a team still chasing a division title while fighting to hold on to the top wild-card spot. Instead, Chapman auditioned in lower-leverage situations and ultimately proved himself with his last two outings, when he allowed only one hit and struck out four without a walk in two scoreless innings.

Chapman apparently convinced Girardi with Tuesday’s perfect eighth, with sharp command of a fastball that hovered in the 101- to 104-mph range. Seven of the 11 pitches were strikes, and Girardi was pleased to see the shorter at-bats. Chapman looked more confident, and while he spouted the company line afterward, you could tell where his heart lies.

“I’ve been a closer for a long time in my career,” Chapman said through his interpreter. “But that’s not the focus here. What matters now is winning.”

Chapman wasn’t available to the media Wednesday, but knowing the manager’s faith has been restored should help with the transition. And a dominant Chapman will upgrade what already is a potentially airtight bullpen, one that needs him in the ninth inning to be operating at its best.

Betances flirted with trouble Tuesday by throwing an inexplicable number of breaking pitches, and after doing the unthinkable — walking Tim Beckham with two outs — he got burned by the sizzling Machado. That’s the conundrum with Betances. At times, he’s unhittable, throwing 100 with that mind-bending slider/curve. But when he loses the strike zone, he struggles to find it again, and those hangers tend to be lethal.

The Yankees believe Betances works best in a set-up role, with a safety net, and Girardi likes the flexibility of using him, David Robertson and Tommy Kahnle in a variety of spots. Now that Chad Green has become a dangerous multi-inning weapon, the Yankees have built what could be an unbeatable bridge to the ninth, as long as Chapman is doing what he’s supposed to be doing.

“I think if he’s your closer, that means he’s throwing well, and that means everyone’s throwing well,” Girardi said. “So that’s your best team.”

The Yankees, with 23 blown saves, have been something less than that, and Chapman’s bizarre season helped derail them early. Girardi had no choice but to demote him Aug. 18, coming off a four-game stretch that included a 14.54 ERA and being ripped for a slash line of .313/.478/.688. Chapman couldn’t get hitters to swing and miss — a stunning development — and looked lost on the mound.

Maybe it’s a stretch to say Chapman is fixed, but he did credit pitching coach Larry Rothschild for helping him recalibrate his fastball delivery, and the results apparently are enough to sway Girardi. Since being stripped of his closer’s title, he has a 1.93 ERA in five appearances, with six strikeouts and one walk in 4 2⁄3 innings.

Girardi wouldn’t go as far as to say that Chapman is exclusively his closer again. That still needs to be discussed. But he’ll get the chance.

“I would not be afraid to use him at any point,” Girardi said.

And from where Chapman’s been, that’s a serious upgrade.