Finally, Yoenis Cespedes is back, after over two months on the sideline.

The Mets activated the enigmatic slugger, out since May 13 with hip flexor and quadriceps injuries, from the disabled list hours before the Subway Series opener at Yankee Stadium on Friday. Manager Mickey Callaway has said Cespedes was returning as a left fielder, though he had taken grounders at first base during his rehab assignment and started one game in the Gulf Coast League there.

His return will give the beleaguered Mets’ lineup a major boost. Before his injury, Cespedes was slashing .255/.316/.474 with a .790 OPS along with eight home runs and 28 RBIs in 37 games.

His return, however, cost Dominic Smith a roster spot, the Mets sending the once highly regarded prospect back to Triple-A Las Vegas. They also promoted reliever Drew Smith from Las Vegas and demoted Corey Oswalt. Oswalt was coming off back-to-back strong outings, having allowed just three hits over 11 innings, but the Mets opted to go with disappointing veteran Jason Vargas in the rotation — he’ll start Tuesday, The Post’s Mike Puma reported on Thursday — now that he’s ready to return from a strained right calf.