The Brazilian right-back had been non-committal about his future plans, even though his contract was due to expire at the end of this month.
That led to Alves being linked with a host of European clubs such as AC Milan and Manchester United, but the 32-year-old has put an end to the speculation by deciding to stay put.
A statement from Barcelona read: ”
Barcelona announces that Dani Alves has accepted the club’s proposal to renew his contract that expired on 30 June.
“The new deal will see the player tied up for two seasons, until 30 June 2017, with an option for a third.”
Alves joined Barcelona from Sevilla seven years ago and has won 19 titles with the Blaugrana, including three UEFA Champions Leagues – with the Catalan giants scooping the Primera Division, Copa del Rey and Champions League treble for the second time in six years in 2014/15.
Alves holds the record for appearances in official games as a foreign player at Barca with 343.