DALLAS - Free agent guard Wesley Matthews and the Mavericks have agreed on a four-year deal with financial terms that will depend on whether centre DeAndre Jordan decides to join him in Dallas.

A person with knowledge of the deal says Matthews and the Mavericks reached an agreement in principle late Thursday night and will wait on the decision from Jordan, who is apparently choosing between the Mavericks and his original team, the Los Angeles Clippers.

The person spoke on condition of anonymity because the deal isn't finalized. Players can't sign until July 9.

Matthews is coming off a ruptured left Achilles tendon sustained in a game against the Mavericks in March. It is unclear if he will be ready to start the season, but the Mavericks targeted him from the beginning of free agency as a potential replacement at shooting guard for Monta Ellis.

Matthews turned down a $64 million, four-year offer from Sacramento.

Ellis averaged 18.9 points last season and was Dallas' first leading scorer not named Dirk Nowitzki since 2000. But the Mavericks didn't pursue him in free agency, and he agreed to a $44 million, four-year deal with Indiana on Thursday.

Dallas has to replace two other starters after the failed trade with Boston for point guard Rajon Rondo, who clashed several times with coach Rick Carlisle and was banished two games into a first-round playoff loss to Houston.

Centre Tyson Chandler was the backup plan for the Mavericks if they don't get Jordan, but he bolted for Phoenix on the first day of free agency.

Matthews was the heart and soul of the Trail Blazers, developing over five years in Portland into a two-way dynamo. He knocked down 3-pointers, got to the basket in transition and was a bulldog of defender for a close-knit starting unit.

Just as the Blazers were picking up steam and gearing up for the playoffs, Matthews went down. Portland was in the midst of a five-game winning streak when Matthews crumpled to the court with the devastating injury, one of the most difficult ones from which to recover in the NBA.

Without Matthews, the Blazers fizzled and were knocked out in the first round of the playoffs by the Memphis Grizzlies.

Players like Kobe Bryant, Chauncey Billups and Elton Brand struggled mightily in their first seasons back from the same injury, with Hall of Famer Dominique Wilkins among the very few who have been able to pick up where they left off upon their return.

Long odds are nothing new for Matthews, who was undrafted out of Marquette in 2009 and fought his way onto Utah's roster before signing with Portland the following year.

___

AP Basketball Writer Jon Krawczynski contributed to this report.