The 33-year-old Spanish midfielder completed the deal with club President Sandro Rosell on Monday, with Vice President Josep Maria Bartomeu and football director Andoni Zubizarreta looking on.
Xavi, who finished third in FIFA Player of the Year voting from 2009-11, said ''this is where I want to be,'' adding that Barcelona had always been his first choice.
He said he knew there were many other players who could play in his position and that the club had ''made an effort, and I am grateful.''
Barcelona had announced plans for the new deal on Dec. 18.
(For more sports news and updates, follow Ahram Online Sports on Twitter at @AO Sports and on Facebook at AhramOnlineSports)