The announcement sets the stage for a conclave next month to elect a successor to the 85-year-old.
The pope's brother, Georg Ratzinger, said the pontiff had been advised by his doctor not to take any more transatlantic trips and had been considering stepping down for months.
Georg Ratzinger said his brother was having increasing difficulty walking and that his resignation was part of a "natural process."
"His age is weighing on him," the 89-year-old said of his 85-year-old brother. "At this age my brother wants more rest."
The Pope announced his resignation in Latin during a meeting of Vatican cardinals, surprising even his closest collaborators, even though Benedict had made clear in the past he would step down if he became too old or infirm to do the job.
He called his choice "a decision of great importance for the life of the church."
The move allows the Vatican to hold a conclave before Easter to elect a new pope, since the traditional mourning time that would follow the death of a pope does not have to be observed.
It will also allow Benedict to hold great sway over the choice of his successor. He has already hand-picked the bulk of the College of Cardinals - the princes of the church who will elect the next pope - to guarantee his conservative legacy and ensure an orthodox future for the church.
There are several papal contenders in the wings, but no obvious front-runner - the same situation when Benedict was elected pontiff in 2005 after the death of Pope John Paul II.
The Vatican stressed that no specific medical condition prompted Benedict's decision, but in recent years, the pope has slowed down significantly, cutting back his foreign travel and limiting his audiences. He now goes to and from the altar in St Peter's Basilica on a moving platform, to spare him the long walk down the aisle. Occasionally he uses a cane.
Benedict emphasised that carrying out the duties of being pope requires "both strength of mind and body."
"After having repeatedly examined my conscience before God, I have come to the certainty that my strengths due to an advanced age are no longer suited to an adequate exercise of the Petrine ministry," he told the cardinals.
"In order to govern the barque of St Peter and proclaim the Gospel, both strength of mind and body are necessary - strengths which in the last few months, have deteriorated in me to the extent that I have had to recognise my incapacity to adequately fulfil the ministry entrusted to me," he said.
Popes are allowed to resign; church law specifies only that the resignation be "freely made and properly manifested." But only a handful have done it.
The last pope to resign was Pope Gregory XII, who stepped down in 1415 in a deal to end the Great Western Schism among competing papal claimants. The most famous resignation was Pope Celestine V in 1294; Dante placed him in hell for it.
When Benedict was elected aged 78, he was the oldest pope chosen in nearly 300 years. He had already been planning to retire as the Vatican's chief orthodoxy watchdog to spend his final years writing in the "peace and quiet" of his native Bavaria.
Benedict said he would serve the church for the remainder of his days "through a life dedicated to prayer."
The Vatican said immediately after his resignation, Benedict would go to Castel Gandolfo, the papal summer retreat south of Rome, and then would live in a cloistered monastery.
Contenders to be his successor include Cardinal Angelo Scola, archbishop of Milan, Cardinal Christoph Schoenborn, the archbishop of Vienna, and Cardinal Marc Ouellet, the Canadian head of the Vatican's office for bishops.
Longshots include Cardinal Timothy Dolan of New York. Although he is popular and backs the pope's conservative line, the general thinking is that the Catholic Church does not need a pope from a "superpower".
Given half of the world's Catholics live in the global south, there will once again be arguments for a pope to come from the developing world.
Cardinal Antonio Tagle, the archbishop of Manila, has impressed many Vatican watchers, but at 56 and having only been named a cardinal last year, he is considered too young.
Cardinal Peter Kodwo Appiah Turkson of Ghana is one of the highest-ranking African cardinals at the Vatican, currently heading the Vatican's office for justice and peace, but he is something of a wild card.
All cardinals under 80 are allowed to vote in the conclave, the secret meeting held in the Sistine Chapel where cardinals cast ballots to elect a new pope.
As per tradition, the ballots are burned after each voting round; black smoke that snakes out of the chimney means no pope has been chosen, while white smoke means a pope has been elected.
The pontiff had been due to attend World Youth Day in July in Rio de Janeiro; by then his successor will have been named and will presumably make the trip.
Benedict himself raised the possibility of resigning if he were simply too old or sick to continue on, when he was interviewed in 2010 for the book "Light of the World."
"If a pope clearly realises that he is no longer physically, psychologically and spiritually capable of handling the duties of his office, then he has a right, and under some circumstances, also an obligation to resign," Benedict said.
The former Cardinal Joseph Ratzinger had an intimate view as Pope John Paul II, with whom he had worked closely for nearly a quarter-century, suffered through the debilitating end of his papacy.
The announcement took the Vatican - and the rest of the world - by surprise.
Several cardinals did not even understand what Benedict had said during the consistory, said the Rev. Federico Lombardi, the Vatican spokesman. Others who did were stunned.
"All the cardinals remained shocked and were looking at each other," said Monsignor Oscar Sanchez of Mexico who was in the room when Benedict made his announcement.
Benedict was born on April 16, 1927 in Marktl Am Inn, in Bavaria, but his father, a policeman, moved frequently and the family left when he was 2.
In his memoirs, Benedict dealt what could have been a source of controversy had it been kept secret - that he was enlisted in the Nazi youth movement against his will when he was 14 in 1941, when membership was compulsory.
He said he was soon let out because of his studies for the priesthood. Two years later he was drafted into a Nazi anti-aircraft unit as a helper. He deserted the German army in April 1945, the waning days of the war.
He called it prophetic that a German followed a Polish pope - with both men coming from such different sides of the Second World War.
Benedict was ordained, along with his brother, in 1951.
After spending several years teaching theology in Germany, he was appointed bishop of Munich in 1977 and elevated to cardinal three months later by Pope Paul VI.
John Paul named him leader of the Congregation for the Doctrine of the Faith in 1981 and he took up his post a year later.