The Dallas Mavericks unexpectedly landed a superstar on Thursday, trading for the New York Knicks’ Kristaps Porzingis. It was a masterful move by the Mavs, who capitalized on a recently-turned-sour relationship between Porzingis and the Knicks to land the disgruntled seven-footer for essentially nothing, emerging from the deal with arguably the most promising guard-forward combo in the league.

Porzingis was, until maybe 72 hours ago, the Knicks’ franchise player. He melds strong defense around the rim with the ability to shoot from deep, and at 23 years old he’s already one of the most dynamic players in the league. He was named to the All-Star team last year after averaging 22.7 points per game while shooting 39.5 percent from three, but he tore his ACL in February and hasn’t played since. Pairing Porzingis with Mavs rookie Luka Doncic seems almost unfair. Assuming Porzingis fully recovers from his ACL injury—and right now there’s no indication that he won’t—he and the six-foot-seven Doncic should play well together. Mavs officials are already salivating, comparing the young stars to the old duo of Steve Nash and Dirk Nowitzki. “We obviously think Porzingis is a great young talent, similar in many ways to Dirk,” coach Rick Carlisle said on the Mavs’ flagship station, 103.3 FM ESPN, on Thursday, according to ESPN. “This is kind of a Dirk-and-[Steve] Nash type of situation, only these guys are taller.”

For what it’s worth, the addition of Porzingis has Nowitzki’s complete approval. “He’s got a franchise-type player game,” Nowitzki said after the trade, according to the Dallas Morning News. “He’s a perfect fit for the new NBA. He’s mobile enough to play the four (power forward), he can be a spread-five (center), he can roll, block shots, post. Before he got hurt, he played a great all-around game—and he’s got the work ethic to be great.”

The trade for Porzingis comes at a key moment for the Mavs. Nash, of course, is long gone, and Nowitzki is nearing retirement; the Mavericks have slipped from a perennial playoff team to a franchise in rebuild mode—a rebuild that, until very recently, appeared to be going nowhere. Following their last playoff appearance in 2016, the Mavs tried to add some young core players in an attempt to keep the team competitive as Nowitzki slowly phased out of his star role, banking on Harrison Barnes (whom they signed to a max contract) and Nerlens Noel. It became clear in the 2016-17 season that those moves were not nearly enough, and Dallas finished with one of the worst records in the league. The Mavs earned a lottery pick, which they spent on guard Dennis Smith Jr., an athletic but raw talent. Smith showed promise as a rookie but wasn’t able to put everything together, and with their lottery pick last year the Mavs took another guard, Doncic, signaling the start of a rebuild over a rebuild.

Doncic immediately took the league by storm—we wrote a little about that already—and he has cemented himself as arguably the best young player in the league. At 23-28, the Mavs have shown improvement over last year, but it’s clear that Doncic will need a stronger supporting cast going forward. Before the Porzingis trade, the Mavs had a weird mix of young talent and veterans, but it was not built for Doncic and was unlikely to work long-term. After the Porzingis trade, Doncic now has the most important part of any title contender in a perfect-complement superstar, and much sooner than expected. The Mavs gave up Smith (his role on the team was essentially nullified once Doncic emerged), veterans Deandre Jordan and Wesley Matthews, as well as two future unprotected first-round draft picks in return for Porzingis, Tim Hardaway Jr., Trey Burke, and Courtney Lee. None of those players except for Porzingis are likely to play large roles in the Mavs’ future, but they’re all serviceable role players for the time being. Trading for a superstar like Porzingis makes even more sense when you consider that the Mavs have been chronically unable to sign a true superstar through free agency, despite being awash in cash.

But the Mavs are still taking on some risk here. Porzingis could leave after 2020, when he is set to become an unrestricted free agent, and there are some concerns about his long-term durability. So it’s possible the Mavs could end up with nothing out of this trade. They’ll have to convince Porzingis that playing with Doncic is worth sticking around for, or at least that their franchise is a better-run outfit than the Knicks—which won’t be hard. There’s a good chance Mavs fans will be able to enjoy the Doncic-Porzingis duo for years to come.