Three years ago Monday, Sean Marks left a powerhouse in San Antonio, where he was being groomed by not one but two future Hall of Famers. He left to take over the Nets, tasked with turning around the biggest mess in sports.

On the anniversary of Marks’ hiring, the Nets are one of the NBA’s biggest surprises — even if the rise hasn’t surprised those who know him best.

“He realized there were big challenges ahead, but he’s never one to shy away from challenges,” Spurs GM R.C. Buford told The Post. “It doesn’t surprise me that he and Kenny [Atkinson] have had the impact they’ve had. … The impact of the culture they’re building is becoming apparent.

“It’s evident in everything, his ability to create relationships, to build culture. … He’s got an unbelievably engaging personality. That’s why he gets people to believe his vision. That’s the reason there’s such an impact he can have.”

Marks, 43, won titles under Gregg Popovich first as a player and later as an assistant coach. Then he went back to being groomed by Buford, serving as assistant GM when the Nets came calling. But neither Spurs job was coming open anytime soon, so Marks took a project of his own, packing up his family — wife Jennifer and their four sons — and moving to Brooklyn.

“You’ve got to do what’s best for you and your family,” Buford said.

“He’s a great friend of the whole family. We’ve been rooting for his success and the success of their group since he went,” Popovich said. “It’s obviously very positive and going in the right direction, and I couldn’t be more thrilled.”

Marks took on a 21-61 team that was over the cap and bereft of first-round picks. Unable to get a star via trade, lottery or free agency, the most vital lesson Marks had to learn was patience, beefing up the scouting and performance departments and banking on a slow build.

“It’s one thing to say you’re going to have patience, do your due diligence, it’ll all come. That’s easier said than done,” Marks told The Post. “It’s easy to say we’re going to sit out this free agency, sit out this particular thing. There’s been a learning curve there. If you ask the people around me, they’ll tell you I’m not the most patient person.”

So he had to learn. And he had to convince others to do it with him.

Marks — a native New Zealander coming from Texas — pitched Brooklyn as a spot to live. But he also sold his vision, that his talk of family culture wasn’t just shtick.

“People didn’t come to Brooklyn because they didn’t have a choice: I had to pry them out of places,” Marks said. “I had to ask, ‘Do you want to come here with me? Please?’

“The people who bought in and saw the potential, this vision, they’re the ones building it. This is 65 basketball operations people. This is 400 people on the business side.

“We look at it like a startup. We were a penny stock. Maybe we’re worth 10 cents now. Someday we’ll be worth a dollar. One day this franchise is going to be worth 10 bucks. But don’t wait to get in.”

He had to convince Trajan Langdon to leave the then-defending champ Cavaliers to be his assistant GM. And Harvard Law grad Natalie Jay to give up clerking for judge Raymond W. Gruender — on the short list for the Supreme Court — and be a capologist. And Zach Weatherford — in charge of conditioning the Navy SEALS — to head the performance team.

Marks even had to convince players in his own locker room. How?

“[By] him making the changes he said he was. More so than somebody saying we want to win, we want to make change: It actually happened,” said Rondae Hollis-Jefferson, the only current Nets player who predates Marks.

“When things first happened, you’re on the skeptical side. … Just believing in him as a GM was hard for me at first because as a human, we all have trust problems and issues. But it grew on me. I listened to what he said and just fell in love with everything he was doing. We’re winning now. … Look at where we’re at today.”

There were a lot of tough yesterdays to get to today, from the 116 losses the first two years to the failed Jeremy Lin experiment to the swings and misses in restricted free agency.

The Nets had to deal for D’Angelo Russell and develop him into an All-Star. They had to take salary dumps to draft Caris LeVert, Jarrett Allen and Rodions Kurucs. And they had to build projects like Spencer Dinwiddie and Joe Harris into Skills Challenge and 3-Point Contest winners.

Now Brooklyn sits sixth in the East and heads into the offseason with not only cap space to add free agents but a foundation to attract them. They’re in a better place than they were in 2016, when Kevin Durant wouldn’t even meet with them. And while they won’t chase every big name, they’ll be taken seriously by the likes of Kawhi Leonard and Kristaps Porzingis, a restricted free agent.

“Things surrounding the team probably look a lot more attractive to the outside,” Marks said. “We’re a more attractive destination.

“The young guys we know are going to be Nets for the foreseeable future, we’re proud of their development and that’s a pretty good foundation. People have taken notice and said, ‘Hey, I [could] play with that group.”

And play in that environment, one Buford says is fostered by Marks’ persona, family focus and ability to build relationships. And Nets players and coaches back that up, painting a picture of a relatable, positive boss.

“He got a solid couple pair of Jordans. I’ve seen him wear some Jordans I don’t even have,” Hollis-Jefferson said.

“Sean’s the ultimate casual dresser. He’ll come in with a baseball hat and checkered shirt. [It] helps the environment,” said Atkinson, adding, “He’s unwaveringly positive. I’m the curmudgeon and he’s just positive all the time — a super, super positive guy.”

That shows through in a dry sense of humor.

“He definitely has a good sense of humor,” Harris said. “He likes to mess with people on the staff.”

Marks has been messing with people since his Spurs days, when he and Manu Ginobili used to freeze each other’s clothes and cause other mischief.

“Cars were desecrated with stuff I don’t even want to mention,” Marks admitted. “We’ve had singing telegrams in our office here in Brooklyn. I’ve played a few jokes on the coaching staff and the performance team, and they’ve done a few [to] me.”

Marks — for whom Jennifer and the boys are priority No. 1 — has emphasized a family vibe, from helping players’ families settle to bringing them on trips to building them a 1,000-square-foot lounge with babysitters, a kitchen, diaper-changing station and a huge photo of players’ kids playing pickup.

“If we’re going to preach it, we better live it. We talk about being a family: That’s on the court and off court. It can’t just come from me; it has to come from everybody,” Marks said. “The most important thing, bar none, is family, without a doubt. … Every one of us has a mother, dad, significant other, kids, that are sacrificing so we can do our jobs.

“We get to fly on a charter and stay in nice hotels. The people who’re sacrificing are the ones we leave back home. They’re No. 1 priority and it’s not even close. If you take care of those — whether that’s the player wives, the coaching wives, their kids, whatever — you’ll get a return on your investment. I can’t even say it’s tenfold: It’s a hundredfold.”

The return isn’t just improved play but buzz around the league. Porzingis and Jimmy Butler both had the Nets on their short lists of teams they wanted to be traded to. Three years to the day after Marks left San Antonio for Brooklyn, that call is felt in both places.

“From a player standpoint, coaching standpoint, personal standpoint and from a family standpoint, his wife and boys are some of the most revered members of our family that’ve ever been here,” Buford said. “He’s purposeful, smart and really high character, one of the favorite teammates that’s ever been in our family.

“And we like Jennifer lot more.”