The agreement could be extended by a further five years after that the Catalan club said on its website.
The new agreement doubles Nike's financial involvement in Barcelona from the 15 million euros a year previously equalling what the company invests in English giants Manchester United.
On top of the minimum investment, will come bonuses and royalties based on results on the pitch and the sales of Barcelona team shirts which could lift the annual figure to 45 million euros.
Barcelona, whose annual budget tops 300 million euros, in June sold television coverage rights of its matches in the period 2006 to  2013 for one billion euros.