Dani Alves has revealed how Lionel Messi helped convince him to stay with Barcelona when he was feeling undervalued.

Alves appeared to be on his way out of Barca having failed to agree a new deal by the end of the season and given a tearful speech to fans following the Champions League win last weekend.

But the Brazilian put pen to paper on a new two-year deal on Tuesday with an option of an extra year after some choice words from team-mate Messi.

"Messi said to me, 'Dani where are you going to be better off than here?'," Alves told a news conference.

"For a long time we have said that we have a very good life here at this club and in a fantastic city with an ideal climate.

"Everything influences you when you make a decision. We had the same conversation a year ago when they were talking about (other clubs) signing Leo and me. We realised that nowhere would we be better off than here."

The Brazil international accompanied his team-mates to the Nou Camp on Sunday to celebrate their second treble-winning campaign in six years and admitted he is now looking forward to the future with

"In my life, I follow my heart and my heart told me to stay here," he added. "I still have a lot to offer this club and many challenges yet to achieve.

"It's great for me to stay at this club and continue to make history. I have the best team-mates ever. I had never had (or been a part of) such a great group, with such chemistry.

"Several positive factors have led me to make this decision. I am only in the place where I feel loved."

Alves, whose previous deal ended this month, became emotional while speaking on Sunday at the Nou Camp during Barca's treble celebrations, nearly 24 hours after their 3-1 win over Juve in Berlin.

"I had had doubts but on Sunday it was clear to me that many people love me and respect me here," he said. "Before that celebration, had I not had the reception I had, that of being felt valued, loved, it may have been different."

"People had doubted me and thought my career was over. I didn't feel happy, just like I want to be."