Free-agent guard Kyle Korver has agreed to a one-year, $2.6 million deal with the Milwaukee Bucks, his agent Jeff Schwartz of Excel Sports told ESPN.

Korver labored on a decision between the Bucks and Philadelphia 76ers, but his history and relationship with coach Mike Budenholzer played a significant role in his ultimate choice, league sources said.

The 38-year-old Korver played three-plus seasons under Budenholzer in Atlanta and was an All-Star there in 2015.

According to ESPN’s Bobby Marks, the Bucks will incur a $1.6 million cap hit on Korver’s deal. The Phoenix Suns, who waived Korver earlier this month, will receive a $559,000 set-off on the $3.4 million that they owe him.

The most pursued player left on the market, Korver has been one of the most accurate 3-point shooters of his generation, shooting 43 percent in his 16-year NBA career and leading the league in 3-point accuracy four times. He has played in 135 career playoff games.

He joins a Bucks roster that returns the core of an Eastern Conference finalist that had the NBA’s best regular-season record at 60-22. Despite the loss of Malcolm Brodgon to the Indiana Pacers, Milwaukee was able to sign guards Wesley Matthews and Korver in free agency.

Korver started his career with the 76ers in 2003 as a second-round pick and also had stops in Utah, Chicago, Atlanta and Cleveland. Korver was traded twice in the offseason — to Memphis and Phoenix — before he was waived.