The Great Aaron Judge Mystery is finally solved, with the Yankees outfielder officially diagnosed with a stress fracture in his first right rib on Friday.

Judge will take two weeks to heal and the Yankees will reassess the injury at that point. Surgery is an option for the 27-year-old, who had been experiencing discomfort before the team’s first full-squad workout on Feb. 18.

Yankees manager Aaron Boone said he believes the injury dates back to an outfield dive in September.

He’s yet to take batting practice outdoors and now is virtually certain to not be ready for Opening Day on March 26. The biggest question is how much time he’ll miss.

Judge has been plagued by injuries the last two seasons, losing time to an oblique strain in 2019 and a fractured wrist the year before.

“It’s tough, in ’18, I had the fluke injury getting hit,’’ the right fielder had said Thursday, as he awaited test results. “That’s nothing you ever want to have happen and then the following year straining an oblique early in the season. That’s pretty tough. I’m pretty frustrated with it. I want to be out there with my team supporting them on the field, battling with them, hopefully that is why we are talking to a lot of doctors trying to get some answers so we can figure this out and move on.”