Argentinian Jorge Bergoglio has been elected Pope, the first ever from the Americas and the first from outside Europe in more than a millennium.
He has chosen the name Pope Francis.
After announcing "Habemus Papum" - "We have a Pope" - a cardinal standing on the balcony of St Peter's Basilica revealed the identity of the new pontiff, using his Latin name.
Bergoglio had reportedly finished second in the 2005 conclave that produced Pope Benedict XVI, who last month became the first pope to resign in 600 years.
The 76-year-old archbishop of Buenos Aires has spent nearly his entire career at home in Argentina.
Archbishop of Dublin Diarmuid Martin has said the choice of the name Francis symbolising simplicity and poverty is key to understanding the new Pope.
Dr Martin said he had met Cardinal Bergoglio at several synods and he had said he was following the life of the Church in Dublin and it faced the same challenges as those in Buenos Aires.
Dr Martin also said the pundits got it completely wrong and did not understand how Cardinals worked.
He said the choice of a Pope from Latin America was an indication of where the church was going.
Pope Francis will be officially installed as the new leader of the church on 19 March.
Pope Francis addresses crowd
"Pray for me," the new pontiff, dressed in the white robes of a pope for the first time, urged the crowd.
The choice of Bergoglio, who becomes the first Latin American pope, was announced by French cardinal Jean-Louis Tauran with the Latin words "Annuntio vobis gaudium magnum. Habemus Papam" ("I announce to you a great joy. We have a pope.")
Francis becomes the 266th pontiff in the Church's 2,000-year history at a time of great crisis, with the church under fire over a child sex abuse scandal.
Although a conservative, he is seen as a reformer and was not among the small group of frontrunners identified before the election.
He has spoken out strongly against gay marriage, denouncing it in 2010 as "an attempt to destroy God's plan".
Replacing Pope Benedict, who resigned last month, he also overturned one of the main assumptions before the election, that the new pope would be relatively young.
Bergoglio is the oldest of most of the possible candidates and was barely mentioned in feverish speculation about the top contenders before the conclave.
Francis is the first non-European pope since Syrian born Gregory III in the eighth century, and the third successive non-Italian pontiff.
Thousands of people sheltering from heavy rain under a sea of umbrellas had occupied the square all day to await the decision and the crowd swelled as soon as the white smoke emerged.
They cheered wildly and raced towards the basilica as the smoke billowed from a narrow makeshift chimney and St Peter's bells rang.
The excited crowd cheered even more loudly when Francis appeared, the first pontiff to take that name. "Viva il Papa (pope)," they chanted.
Frontrunners at the conclave had included Brazilian Odilo Scherer - and Italy's Angelo Scola, who would have returned the papacy to traditional Italian hands after 35 years of the German Benedict XVI and Polish John Paul II.
In brief remarks from St Peter's balcony, Francis said it seemed the cardinal electors "went to the end of the world" to find him. He said the world should follow a path of love and fraternity and called for the crowd to pray for him.
Bergoglio is the first Jesuit to become pope.
The decision by 115 cardinal electors sequestered in a secret conclave in the Sistine Chapel came sooner than many experts expected because there were several frontrunners before the vote to replace Pope Benedict.
The cardinals faced a thorny task in finding a leader capable of overcoming crises caused by priestly child abuse and a leak of secret papal documents that uncovered corruption and rivalry inside the Church government or Curia.
Francis will head a Church also shaken by rivalry from other churches, the advance of secularism, especially in its European heartland, and allegations of scandal at the Vatican bank.
The series of crises is thought to have contributed to Benedict's decision to become the first pontiff in 600 years to abdicate.
Bergoglio was a moderate rival candidate at the 2005 conclave to the conservative Cardinal Joseph Ratzinger, who went on to become Benedict.
Italian media say he impressed cardinals in pre-conclave meetings where they discussed the Church's problems.
Reserved and humble, Francis does not fit the profile of an active preacher that many cardinals had previously said they were seeking. He studied chemistry before joining the priesthood.
"I wasn't expecting it, but I'm absolutely delighted. It's a very unique moment. There is a great sense of unity here. It's great they have come to a decision about who will lead the Church," said John Mcginley, a Scottish priest from Glasgow who travelled to see the conclave.
"He's very humble, I heard that in Buenos Aires he used to take public transport, have an apartment and cook for himself. The fact that he chose the name Francis means a lot. It means we will have a humble, simple pope close to the poor people. But it was a big surprise," said Jules Charette, 54, a Canadian lawyer who travelled to Rome for the conclave.
Bands from the Italian armed forces and the Vatican's own Swiss guard army paraded in front of the basilica before the new pope appeared.
The secret conclave began last night with a first ballot and four ballots were held on Wednesday. Francis obtained the required two thirds majority in the fifth ballot.
Following a split ballot when they were first shut away amid the chapel's Renaissance splendour on Tuesday evening, the cardinal electors held a first full day of deliberations on Wednesday. Black smoke rose after the morning session to signal no decision.
The previous four popes were all elected within two or three days.
Seven ballots have been required on average over the last nine conclaves. Benedict was clear frontrunner in 2005 and elected after only four ballots.
In preparatory meetings before the conclave, the cardinals seemed divided between those who believe the new pontiff must be a strong manager to get the dysfunctional bureaucracy under control and others who are looking more for a proven pastoral figure to revitalise their faith across the globe.
Apart from Brazil's Scherer and Italy's Scola, a host of other candidates from numerous nations had also been mentioned as potential popes - including US cardinals Timothy Dolan and Sean O'Malley, Canada's Marc Ouellet and Argentina's Leonardo Sandri.
But the frontrunners list never mentioned Bergoglio.
Higgins offers sincere wishes to new pope
President Michael D. Higgins has conveyed his sincere best wishes to Cardinal Jorge Bergoglio on his election as Pope Francis.
In his message, President Higgins said: "As you assume the office of Holy Father, I convey to you the best wishes of the people of Ireland for the success of your pontificate.
"Despite the pressures and distractions of a more complex world, people all over the globe still yearn for a sense of spiritual meaning to their lives.
"Your leadership of the Church will therefore be of immense importance in providing ethical guidance and moral encouragement towards a world that is more just, more compassionate and more focused on a shared sense of community."
Chavez 'may have helped pick Pope Francis'
Late Venezuelan leader Hugo Chavez's influence may have stretched into the afterlife and had a hand in Christ's decision to opt for a Latin American Pope, acting President Nicolas Maduro said.
"We know that our commander ascended to the heights and is face-to-face with Christ," Maduro said at a Caracas book fair.
"Something influenced the choice of a South American pope, someone new arrived at Christ's side and said to him: 'Well, it seems to us South America's time has come.'"
"He (Chavez) may also call a constitutional assembly in Heaven at any moment to change the (Catholic) church on Earth so the people, the pure people of Christ, may govern the world," Maduro added of his mentor.