The All-Star point guard said on his Twitter page Tuesday night that he "made a very tough decision today" and posted a picture of the new team logo that accompanies the Nets' move from New Jersey to Brooklyn.
A person with knowledge of the decision said Williams told the team he was accepting their five-year contract worth $98 million.
Williams, the top free agent available, chose to stay with the Nets over signing with his hometown team, the Dallas Mavericks.
It's a huge triumph for the Nets as they prepare to move into the new Barclays Center to start the 2012-13 season. They gave up an enormous package to get Williams in a surprising February 2011 trade, sending promising forward Derrick Favors, point guard Devin Harris, two first-round draft picks and cash to the Utah Jazz.
But it was worth it for the Nets, who needed a franchise player with them to build buzz for their move to New York.
Williams wanted to make a quick decision before he reports to training camp in Las Vegas with the U.S. men's basketball team on Thursday. He met with both teams Monday, the day after free agency opened, and made his Twitter posting at about 7 p.m. ET.
The person confirmed the agreement on condition of anonymity because contracts can't be signed until July 11.
Williams' decision comes a day after the Nets agreed to a deal with Atlanta for All-Star guard Joe Johnson, and amid reports they are still hoping to make a deal with Orlando for Dwight Howard. Just two years after a 70-loss season, the Nets will have one of the NBA's best backcourts and are poised to make a quick move up the Eastern Conference standings.