Yankees rightfielder Aaron Judge looks for his pitch against the Red...

Yankees rightfielder Aaron Judge looks for his pitch against the Red Sox during the first inning of a game at Yankee Stadium on Tuesday. Credit: Kathleen Malone-Van Dyke

The Yankees got one of their big guns – in reality their biggest one – back just in time for the stretch run.

Aaron Judge, out since July 27 with a right wrist fracture, cleared his final hurdle Tuesday morning in a simulated game and was in the starting lineup for Tuesday night’s game against the Red Sox at the Stadium.

Judge, who batted second and played right, hit a couple of balls hard but went 0-for-4 in the Yankees’ 3-2 win that kept the Red Sox, for one night at least, from clinching the AL East title at the Stadium.

J.A. Happ, acquired in part because of his success against Boston, was terrific, allowing an unearned run and four hits over six innings. Neil Walker’s three-run homer off reliever Ryan Brasier with one out in the seventh inning turned a 1-0 deficit into a 3-1 lead. Chad Green and David Robertson got the ball in the ninth to Zach Britton, who got his sixth save despite two errors, one by him.

The Yankees messed up two apparent double plays, first when second baseman Gleyber Torres couldn’t handle third baseman Miguel Andujar’s throw, and then when Britton fielded a chopper and threw past Torres. Britton started a 1-4-3 double play to end the suspense.

The Yankees (92-58), trying to hold off the A’s for home-field advantage for the wild card, are 10½ games behind the Red Sox (103-48).

But the big-picture story of the night was the return of Judge. In the rightfielder’s first at-bat, against Nathan Eovaldi, he sent a liner to right, which came off his bat at 112 mph but straight at J.D. Martinez.

With two on and one out in the third, Judge swung at a first-pitch fastball and into a 6-4-3 double play. With Gleyber Torres at second and one out in the sixth, Judge flied to the track in right, which allowed Torres to get to third. Judge struck out against righty William Cuevas in the eighth while trying to check his swing on a 3-and-2 pitch.

Earlier in the day, before the start of the rainstorm that pushed the start time to 7 o’clock from 1 o’clock, Judge participated in a simulated game. The session was watched by most of the Yankees’ team hierarchy, including general manager Brian Cashman and manager Aaron Boone.

Judge served as a defensive replacement in Friday’s victory over the Blue Jays but was not yet deemed ready to swing a bat in a game. That changed Tuesday after a second successful sim game in as many days.

“I feel like physically over the last week he’s been ready to go,” Boone said. “It’s just been kind of checking the boxes and making sure he’s done everything. We just felt like, after today, we want to start the clock of getting him in there and playing and getting him those [at-bats], so he can find that timing sooner rather than later. Physically he’s good to go.”

Judge suffered the wrist fracture July 26 against the Royals when Jakob Junis hit him in the first inning with a 93-mph fastball.

The Yankees initially gave a three-week time frame for when they thought Judge might be ready, an estimate Cashman would acknowledge on Sept. 1 was “off considerably.”

But progress came steadily after that. Judge starting hitting off a tee when the Yankees started a nine-game trip Sept. 3 in Oakland, and by the time the Yankees ended the trip in Minneapolis he was taking regular batting practice with the team.

What the Yankees can expect from Judge, who is hitting .282 with 26 homers and 61 RBIs, is “a great question,” Boone said.

“We’ll find out. As I’ve said leading up to this, hitting’s a funny thing. Sometimes it happens real quick, sometimes it takes a little bit of time. Every year it seems like it’s a little bit different when you’ve had a layoff. Hopefully, it clicks for him pretty quickly.”

SUBSCRIBE

Unlimited Digital AccessOnly 25¢for 6 months

ACT NOWSALE ENDS SOON | CANCEL ANYTIME