Barca president Joan Laporta confirmed Guardiola's appointment at a press conference, saying: "The administration of the club has decided that at the end of this season Frank Rijkaard will cease to be the coach of Barcelona and the position will be occupied by Josep Guardiola.
"Josep has the knowledge, the optimism and the self-confidence to achieve success."
Guardiola, who will officially take charge on 30 June, is a Barca legend who was captain when they won the European Cup for the first time in 1992, and also collected six league titles while at the Nou Camp.
With Barca set to finish trophyless for a second successive campaign, there had been constant speculation over Rijkaard's future and former Chelsea boss Jose Mourinho, Villarreal coach Manuel Pellegrini and Michael Laudrup of Getafe had all been linked with his job.
Spanish football expert Graham Hunter told BBC Radio 5 Live: "The decision to sack Rijkaard has been building for the majority for the season.
"The directors had been losing faith in him, and rightly so, for several months. In my view, the time was right to remove him in January - trophies could have been won if that action was taken.
"A large majority of the board wanted Mourinho to replace him but Laporta is the president and said he wanted his own man, who is Guardiola.
"I think they have made a bad decision and they will regret it.
"What you need in that dressing room is experience at man management. Rijkaard has failed in the last few months because of poor individual man-management and Guardiola cannot have the skills yet with his limited experience."
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.