Guardiola announced he will leave the club at the end of the season, explaining at a news conference held at the Camp Nou that the demands of the job were too high and his energy levels too low to continue.
Already Barcelona's most successful manager, Guardiola can add a 14th trophy when his team plays the Copa del Rey final against Athletic Bilbao on May 25 in his last game.
His assistant Tito Vilanova will then take over the team.
"Four years are long and they wear you down," Guardiola said. "I think that sincerely that the next person will have things to bring that I can't.
"Every day during four years, the demands are very high, the pressure, the necessary energy to push the players and enjoy it. I need to rest and move away."
His announcement ended a difficult week for the team that saw it exit the Champions League semifinals to Chelsea following a loss to Real Madrid which will likely cost it a fourth straight Spanish title.
Guardiola said he took the decision to quit in December but preferred to wait until the team's chase for major trophies was out of the way. He had extended his rolling one-year contract by February of the past two seasons but his decision not to do so this time led to ongoing speculation over his future.
"I'm very sorry for all of the uncertainty I created over this time over my future, maybe that was an error of mine," Guardiola said. "I didn't mean to create this kind of mood."
Guardiola's news conference was attended by Carles Puyol, Xavi Hernandez, Victor Valdes, Cesc Fabregas, Sergio Busquets and Pedro Rodriguez — although three-time world player of the year Lionel Messi, the player Guardiola built his team around, was absent.
"Leo is with us now," Guardiola said. "All the players are here with me. I don't remember any single title, rather the emotion I shared with my players. You do everything for the trophy, but you take away the feeling."
Messi later said he was too moved by the moment to attend the news conference of the coach that had helped him become the club's all-time leading scorer with 243 goals.
"I want to thank Pep with all my heart for everything he has given me personally and professionally," Messi wrote on his Facebook page. "Due to the emotion I am feeling, I preferred not to be present at Pep's news conference and instead far from the media, above all because I know that they would look for the players' faces and that is something I decided not to show."
The 41-year-old Guardiola has led Barcelona to 13 trophies since replacing Frank Rijkaard at the beginning of the 2008-09 season, surpassing Dutch great Johan Cruyff as the European powerhouse's most successful coach in its 113-year history.
Under the former Spain international, Barcelona doubled its number of Champions League trophies with wins in 2009 and 2011, claimed three straight Spanish league titles, won two Club World Cups, two European Super Cups, three Spanish Super Cups and one Copa del Rey.
In 242 games, Guardiola has guided Barcelona to 175 wins, 46 draws and 21 losses and a goal difference of 618 to 178.
"No one will ever match what he has done," Spain coach Vicente del Bosque told the Associated Press on Friday. "Especially when you consider the level of what he has achieved, the image he has shown, his behaviour — I'm sure it was the best decision for him and for Barca.
"He was a great example for all, a Spanish coach which has represented (our football) very well."
Guardiola's rivalry with Madrid coach Jose Mourinho has also been one of the most engaging La Liga story lines since the Portuguese coach's arrival at Madrid in 2010, as their once seemingly normal relationship as former Barcelona employees descended into acrimony with each of the 11 "clasicos" played between the teams over the past two seasons.
Vilanova has been Guardiola's right-hand man since the pair took over Barca B in 2007-08, earning the team promotion to the second division.
"I think the club is right (on Tito). He is more than qualified, and the players know him, he will change very little of what we do, and he will give a lot to the players and club," Guardiola said. "I can't fool myself that I have the same energy as before."
"Why Tito?" sport director Andoni Zubizarreta said. "Because he represents the game, the analysis, the preparation, he puts the extra hour into preparation, he has the capacity and the personality to be here because we know him. So we decided to look inside our house and it was easy."
Guardiola did not reveal his plans for the future except for saying he would like to return to coaching again sooner rather than later.
Specifically, Guardiola denied having had contact with English club Chelsea.
"No. It would be disrespectful to the club, I haven't met with anyone," he said. "I don't know when (I'll return to coaching). Now I need to rest and look at it from outside. Life will take me where it wants to go."
AP Sports Writer Paul Logothetis contributed to this report from Madrid.