Beno Udrih is out for the season after foot surgery. (AP)

The Miami Heat are nearing agreement with guard Beno Udrih on a contract buyout to offset the salary and luxury-tax implications of signing Joe Johnson, league sources told The Vertical.

The Heat approached Udrih's representatives late last week about a possible buyout and discussions progressed over the weekend, sources said. Ultimately, the choice to settle for a buyout or be released outright rests with Udrih.

Udrih is in the final year of two-year, $4.2 million contract he signed with the Grizzlies in 2014.

Miami has also held discussions with free-agent guard Marcus Thornton and could pursue a third point guard behind Goran Dragic and Josh Richardson, sources said.

The Heat were $218,000 below the luxury tax line before signing Johnson and have made clear their plan is to avoid paying the tax. By reaching a buyout agreement with Udrih, Miami would balance out the salary of Johnson and other possible additions to the roster.

Udrih, 33, had surgery on his right foot Friday and is out for the remainder of the season.

Udrih served as the Heat's primary backup to Dragic since the team acquired him from Memphis in November. He averaged 4.4 points and 2.5 assists per game this season.

In 12 NBA seasons with San Antonio, Sacramento, Milwaukee, Orlando, New York, Memphis and Miami, Udrih has averaged 8.5 points and 3.4 assists.

More NBA coverage from The Vertical: