It took a few days of negotiating but the Milwaukee Bucks finally landed their man on Friday night.

Unrestricted free agent O.J. Mayo agreed to a three-year, $24 million contract with the Bucks, according to a league source.

Milwaukee had a pressing need at the position after last season's starter, Monta Ellis, opted out of the final year of his contract and reserve guards Mike Dunleavy and J.J. Redick agreed to free-agent terms with other teams earlier this week.

Dunleavy agreed to a two-year deal with the Chicago Bulls and Redick agreed to a four-year, $27 million contract with the Los Angeles Clippers as part of a sign-and-trade deal which netted the Bucks two future second-round picks.

The 25-year-old Mayo opted out of the second year of his contract with the Dallas Mavericks and picked up a nice raise in the process. He was owed $4.2 million by Dallas had he opted in but now will be making $8 million per year with the Bucks.

Mayo was the Mavericks' second-leading scorer last season, averaging 15.3 points while starting all 82 games. He also averaged 4.4 assists and 3.5 rebounds while playing 35.5 minutes per game.

The market for shooting guards in free agency has been robust. In addition to Mayo and Redick, Kevin Martin agreed to a contract for four years and $28 million with Minnesota, J.R. Smith stayed with the New York Knicks for four years and $25 million and Kyle Korver agreed to a four-year, $24 million contract to stay with the Atlanta Hawks. Point guard Jose Calderon reached a four-year, $28 million deal with Dallas on Friday.

Mayo and the Bucks will be able to sign the deal on Wednesday when the league's moratorium period ends.

Ovinton J'Anthony Mayo played one year at Southern Cal and was the third overall pick in the 2008 draft by Minnesota. But he was traded to Memphis and spent the first four years of his NBA career with the Grizzlies.