Caleb Martin and Quentin Grimes are poised to switch locker rooms in Philadelphia.

The Dallas Mavericks are acquiring Martin in a trade with the 76ers that sends Grimes back to the Eastern Conference, two people with knowledge of the deal said Tuesday. The teams were playing later Tuesday.

The Mavericks made the move three days after the seismic trade that sent Luka Doncic to the Los Angeles Lakers for Anthony Davis in a rare swap of superstars. The people spoke to The Associated Press on condition of anonymity because the trade is awaiting league approval.

Martin, who has been out since Jan. 10 with groin and hip injuries, and Grimes both were in their first seasons with their teams. The Sixers had listed Martin as questionable Tuesday night with a sprained right hip.

Martin turned down more money from Miami to sign with the 76ers in hopes of chasing a championship with Joel Embiid, Tyrese Maxey and Paul George.

Grimes joined the defending Western Conference champion Mavericks in an offseason trade with Detroit. Dallas also added Klay Thompson in a sign-and-trade in what looked to be a move to bolster the pairing of Doncic and Kyrie Irving before the shocking trade of Doncic.

Now Martin is a secondary piece in the third significant trade-deadline makeover of the Mavericks in the past four seasons. The second brought Irving from Brooklyn and a year later helped Dallas reach the NBA Finals for the first time since 2011. The Mavs lost to Boston in five games.

Martin averaged 9.1 points and 4.4 rebounds in 31 games for the Sixers. Grimes averaged 10.2 points in 47 games for the Mavericks.

Both have been off-and-on starters most of their careers. Before getting sidelined by injuries, Martin started 24 games this season. Grimes started 12 games while shooting a career-best 40% from 3-point range and being one of Dallas’ top defenders.