The 24-year-old Uruguayan joins the Black Cats after spending last season on loan there, making 10 Premier League appearances and impressing towards the end of the campaign under manager Dick Advocaat.
Coates started just 17 times for Liverpool since signing from Nacional for £4.9 million in 2011.
He scored twice for the Reds, included the memorable acrobatic strike against QPR in 2012.
“He has Barclays Premier League experience, which is important and, after spending last season on loan with us, he will be able to settle into the team very quickly.”
Coates becomes the first player to be sold this summer, but is expected to be the first of many to leave.
Liverpool are keen to offload Fabio Borini, Mario Balotelli, Rickie Lambert, Jose Enrique and Luis Alberto.
Steven Gerrard, Brad Jones and Glen Johnson left the club after their contracts expired this summer, while Iago Aspas completed his move to Sevilla before being sold straight back to Celta Vigo.
All the best, Seba.