SALT LAKE CITY — Royce O’Neale’s teammates hugged him and yelled in celebration. His mother simply couldn’t stop crying tears of joy.

After years of looking for a spot — going through summer camps, mini camps, playing in Europe — O’Neale has a permanent home.

The Jazz and Royce O’Neale have agreed to four-year, $36-million contract extension, keeping the homegrown stalwart defender in Utah for the long term.

ESPN was the first to report the deal.

“I felt like it was the right time,” O’Neale said. “Everybody on teams jelling, in a great place, I felt I was really comfortable in my situation — playing a big role in the team, being in Utah and being able to play basketball.”

Earlier in the season, Jazz coach Quin Snyder had a list of all the players that O’Neale had matched up with. There was Giannis Antetokounmpo, Kawhi Leonard, Chris Paul, LeBron James, Kyrie Irving, and on and on.

“They were literally like 10 of the top offensive players in the league,” Jazz executive vice president of basketball operations Dennis Lindsey said. “And they were obviously pleased with what he was doing.”

That defensive versatility has made O’Neale such a valued member of the team. He can guard smaller point guards, he excels on wings, and he can switch and defend bigs in a pinch. He has made key defensive stops in crunch time and his defensive rebounding has been won games for the Jazz.

On Nov. 6, Philadelphia’s Ben Simmons got the ball in the post with O’Neale on him. Simmons faced up and then lowered his shoulder into O’Neale as he tried to go by on the baseline. That play resulted in Simmons having to leave the game with an injured shoulder.

“We got an acronym JPN — Jazz Physical Nature — which goes way back to Karl Malone days,” Lindsey said. “That's kind of what the program stood on. So you know, using the past to build the standards of now. Royce is authentically tough. He doesn't talk about being tough, he doesn't cheap shot guys, but when you meet body-to-body contact with Royce, you know.”

Each summer, the Jazz bring in dozens of players for a free agent minicamp. Some are G League players, some have been playing overseas, some are former draft picks looking for another shot.

It's part of the process of doing all they can to help the team.

“We work hard at that,” Lindsey said of the camps. “It's a multi-purpose event where we bring in some of the top college assistants around the country, we bring in international coaches to network and get good information but a big piece of it is to identify future summer league players, G League players, emergency call ups to see who’s in shape — every so often you strike gold.”

O’Neale represents the gold rush. He attended the Jazz’s free-agent minicamp in 2016. A year later, he was signing a partially guaranteed deal with the team. And now, he's developed into a player who would have had plenty of suitors if he had reached restricted free agency this summer.

O’Neale can tactically matchup against four positions and he’s shooting 44% from the 3-point range. He's tough, can defend and can knock down the open shot. He fits just what the Jazz (not to mention the rest of the league) wants in a role player.

"His character and his talent and his growth in front of us here in Utah means a lot to us," Jazz general manager Justin Zanik said. "As a person, the way he is in the community, there's a right fit.

And now he's part of a core that could be together for years to come.

O’Neale is locked in for four more years, Bojan Bogdanovic has three years after this season and the Jazz are expected to sign Rudy Gobert and Donovan Mitchell to long-term extensions as soon as they can.

O’Neale’s contract also gives the Jazz some flexibility to improve their roster this summer.

They will be $18 million below the tax line (if Mike Conley opts in to the final year of his deal, as expected) and will have $9.8M midlevel and $3.9M biannual exception to sign additional players. Jordan Clarkson and Emmanuel Mudiay are the only non-rookies who will be free agents this summer.

The Jazz hope to see improvement from O’Neale over the course of the deal, but they gave him the same message they gave to Gobert after the All-NBA center signed his rookie extension: Just be who you are.

“It means a lot,” O’Neale said of the deal. “Thinking back from when I started overseas to summer camps, mini camps, to where I am now. Just honored to be in a position that I am. Grateful for the opportunity so I could tell my story to younger kids or everybody else. Just the journey — never give up.”