Willy Hernangomez was teammates with Kristaps Porzingis in Spain, and will be reuniting with him on the Knicks next season.

The Knicks reached an agreement on a multiyear deal with Hernangomez, a source said. The 6-10 center played for ACB power Real Madrid this past season, and averaged 5.8 points and 3.7 rebounds in 40 games. He played with Porzingis on Sevilla two seasons earlier.

“He’s ready to come over here,” Knicks coach Jeff Hornacek said last week. “He had a pretty good year over there in Europe. He’s a big body, skilled, he’s a low-post guy that will fit good in the system.”

The Knicks also reached an agreement with 6-9 Lithuanian combo forward Mindaugas Kuzminskas on a two-year deal, a source confirmed. A report indicated he would get $6 million over two years.

Kuzminskas, 26, played in Spain the past three years for Unicaja Malaga. He averaged 11.1 points in 57 games last season. A source said he will be a roster player for the Knicks.

An NBA scout described Kuzminskas as “a good north-south athlete, whose shot looks good.” Kuzminskas hit 33.9 percent from three-point range last season, and connected on 48.5 percent of his shots overall.

These two agreements give the Knicks 11 players. They can’t announce any signings until the moratorium is lifted Thursday. But it’s been a busy two weeks for team president Phil Jackson and general manager Steve Mills as they continue their overhaul.

The Knicks acquired Derrick Rose from Chicago two weeks ago, and have struck free-agent deals with Joakim Noah, Courtney Lee, Brandon Jennings, Lance Thomas, Hernangomez and Kuzminskas.

They still have spots to fill, including a third point guard.

Hernangomez, 22, was taken with the No. 35 pick in the 2015 draft by Philadelphia. The Knicks acquired his draft rights for cash. Hernangomez averaged 7.1 points, 4.1 rebounds and shot 56.1 percent in four professional seasons in Spain.

Hornacek has watched video of him and says he’s more of a center than power forward, but noted Hernangomez has “good touch” on his midrange shot.

“He has played against some pretty good competition over there,” Hornacek said. “I think he’ll be able to pick things up pretty quickly. He’s got size and some bulk . . . . We can always use those type of guys.”