The new deal with French oil and gas company Total will begin with the 2017 Africa cup of Nations finals in Gabon.
For the time being the value of the deal has not been revealed.
"The parties have agreed not to release the amount of the deal for time being," Caf's director of communication, Junior Binyam, told BBC Sport.
Total take over from mobile phone company Orange, whose deal came to an end in 2016, as headline sponsor of its 10 competitions.
"This partnership is a major milestone in our ongoing search for additional resources to accelerate African football's development, bring its governance up to date, upgrade its sports infrastructure and advance its performance globally," Caf president Issa Hayatou said in a statement.
Patrick Pouyanné, president and chief executive officer of Total, had this to say on the deal: "Football is equal parts enthusiasm, sharing and team performance, concepts that resonate across cultures.
"We are delighted to partner with Caf, because Africa is part of Total's makeup.
"Through this commitment, we hope to strengthen ties to our stakeholders and customers through exciting, celebratory events that are always popular, including within our own teams."
The Confederation of African Football (Caf) has signed a new main sponsor for its top club and national team competitions for the next eight years.