Kristaps Porzingis has not been doing most of his ACL rehab in Latvia as previously thought, but secretly working in Spain with Real Madrid, according to multiple sources.

Porzingis has conducted much of his offseason rehab in Madrid at its training facility that houses its superpower basketball and soccer clubs.

Real Madrid’s basketball team is in the Final Four of the EuroLeague and features top-three lottery pick Luka Doncic and ex-Knicks point guard Chasson Randle. Unless the Knicks trade up from the No. 9 draft pick, Porzingis and Doncic will not be teammates in New York.

After his exit meeting, Porzingis flew to his hometown of Leipaja, Latvia, but believes he’s in good hands in Spain, where he played three seasons in the Spanish League and speaks the language fluently.

“KP is doing great in Madrid,’’ said Carlon Colker, Porzingis’ performance doctor based in Greenwich, Conn. “His aggressive rehab is at a jaw-dropping rate. In conjunction, his body is already looking beastly. By September, he’ll be almost non-recognizable with his shirt off. We’re working on increasing his lean muscle mass and also training for a functionality and ruggedness to compliment his game.’’

His best buddy, Willy Hernangomez, also lives in Spain and once played for Real Madrid.

“Things are moving on as expected,’’ GM Scott Perry said Tuesday at the lottery. “We’re looking forward to monitoring him throughout the summer.”

In making good use of Real Madrid’s state-of-the-art facility, Porzingis will stay in Europe most of the offseason, continuing his unorthodox marriage to the Knicks.

New Knicks coach David Fizdale said he would visit Porzingis after this week’s draft combine, but likely will see him in Latvia so he can meet his family and see his hometown.

After his mid-February surgery, Porzingis was rehabbing at the world-renowned Hospital for Special Surgery, which is the Knicks’ adopted facility.

It is not uncommon for Porzingis to go rogue. Instead of working with the Knicks staff on his strength training that goes beyond the knee rehab, he headed to Greenwich to bulk up with Colker, who was Shaquille O’Neal’s guy and is independent of the Knicks.

Before this season, Porzingis also brought over to New York his longtime physio from the Spanish League, Manolo Valdivieso, on his own dime. Valdeveiso, who worked with Porzingis when he played for Seville, is in Madrid working with Porzingis following Colker’s unorthodox exercise regimen.

Colker told The Post he will visit Porzingis later this summer to continue strength building. Porzingis attended only two games after the surgery and was rarely seen at the Knicks practice facility.

Porzingis, who underwent ACL surgery in mid-February, is most likely going to return within a 10- to 12-month time frame from the surgery. However, owner James Dolan added doubt to that projection when he didn’t rule out Porzingis missing the season in a Post interview.

On Tuesday, Perry said the club may figure out a clearer timetable at the six-month mark after surgery — which is in September. At that juncture, Porzingis will be back in the US.

Porzingis’ rehab is being captured on an online documentary series and the Real Madrid footage likely will highlight the next installment. The initial 24-minute episode revealed the family toasting with shots of tequila on the night of the tragic injury as a symbolic gesture to a new chapter unfolding.