Xavi and Lionel Messi.
Xavi expects Messi to stay at Barcelona forever. Getty

Xavi Hernandez has warned Barcelona that failing to tie Lionel Messi to a new deal "would be a historical mistake". Meanwhile, the club legend has confirmed plans to return to the Nou Camp to become the manager of the La Liga giants.

Messi, 29, has already scored 41 goals in the current campaign, but his long-term future at the Nou Camp has come under question amid delays in negotiations over a new deal.

Neymar, Luis Suarez, Sergio Busquets, Javier Mascherano and Ivan Rakitic have all put pen to paper on new deals at Barcelona in recent months, but the Argentine is yet to follow despite his current contract being set to expire in the summer of 2018.

In January Barcelona technical secretary Robert Fernandez said negotiations with the five-time Ballon d'Or winner were on track – but the club are yet to provide any updates since.

Xavi has now encouraged his former side to step up talks after claiming both Messi and the club need each other.

"Leo is the greatest player, he is the best player in history. His importance will become even clearer once he retires. I am convinced [he will sign a new deal] because I see him.. he looks more mature and calm than ever before. I honestly cannot see him changing clubs," the Spanish icon said to TV3. "Barcelona need Messi, but Messi also needs Barcelona. It would be a historical mistake for Barcelona not to renew him. I think he should sign a new deal because both need each other mutually. I have the felling he will do it."

Xavi left the Camp Nou in 2015 to continue his career at Qatari side Al-Sadd. Yet, the 37-year-old has claimed that he wants to follow the road taken by Luis Enrique and Pep Guardiola and return to Barcelona as a manager in the near future.

"Now I have seen that I like to be close to the pitch, the grass, to smell it, [Johan] Cruyff told me this once. He told me, to play is the best, but later you will be a coach. I told him that I didn't see it, because I was playing and competing. Now I am focused on being on the bench," Xavi added. "Barcelona is my passion. I want to be part of the future of Barcelona. It's complicated because you have to be very prepared but [managing at] Barcelona is my hope."