The deal includes a player option after the third year, and reachable incentives that could push the deal's overall value to $46 million, league sources said.
Snell's agent, Austin Brown of CAA and Bucks general manager Jon Horst closed on the deal post-midnight at the start of NBA free agency on Saturday, league sources said.
After playing his first full season with the Bucks following a trade from the Chicago Bulls, the 25-year-old Snell had his best professional season in 2016-17. He is emerging as a legitimate two-way player, a solid defensive wing who shot a career-best 41 percent from the 3-point line.
Snell made an impact in the Bucks' six-game Eastern Conference first-round playoff loss to Toronto, averaging 10 points and shooting over 50 percent from the field and 3-point line.