White smoke billowed from a Sistine Chapel chimney on Wednesday to show that a new pope has been elected to replace the frail Benedict XVI as leader of the world's 1.2 billion Catholics.
Tens of thousands of pilgrims in St Peter's Square cheered and the bells of St Peter's Basilica rang out after the 115 cardinals meeting in a Vatican conclave signalled their momentous decision.
The 266th pope in the Catholic Church's 2,000-year history -- his identity is still a secret -- was due to emerge from the balcony of the basilica.
A huge crowd chanted "Habemus Papam!" ("We Have a Pope!") as they waited, waving flags from around the world.
Cardinals have been locked up behind the Vatican walls and cut off from the outside world since Tuesday, meeting in a sublime Renaissance chapel swept for recording devices and installed with scramblers to prevent any communication.
The smoke which poured out of the chimney shortly after 1800 GMT was produced by burning the ballots and setting off smoke flares in two stoves specially installed in a corner of the chapel.
The decision came after five votes -- longer than for Benedict's succession to late pope John Paul II in 2005 which was decided in just four votes.
The historic election after Benedict's abrupt resignation last month was being followed around the world on live television as as well as through social media and smartphone apps -- this is the first ever tweeted conclave.
The Vatican has said the cardinal nominated to be the next pope will retire to a "Room of Tears" next to the Sistine Chapel to don his papal vestments and then pray in the Pauline Chapel before speaking on St Peter's Square.
Brazil's Odilo Scherer, Canada's Marc Ouellet and Italy's Angelo Scola -- all conservatives similar to Benedict in outlook but different in style -- were the three favourites but papal elections are notoriously difficult to predict.
Other possible candidates include Peter Turkson from Ghana, Luis Antonio Tagle from the Philippines and Timothy Dolan from the United States.
The odds have been stacked against cardinals from Africa and Asia -- two-thirds of the voter cardinals were from North America and Europe.
All the "Princes of the Church" were appointed by Benedict or his predecessor and ideological soulmate John Paul II.
But the names of cardinals from Latin America, where the largest number of the world's Catholics actually live, have also been in the rumour mill.
US President Barack Obama also chimed in on Wednesday, saying an American pope could be just as effective as any other, before quipping: "But the (US) conference of Catholic bishops... don't seem to be taking orders from me."
Benedict's eight-year papacy was riven by scandals and the new pope will face immediate challenges -- stamp his authority on the Vatican machinery and try to bring back a Catholic flock that is deserting churches across the West.
Benedict's style was often seen as too academic and he was never as popular as his predecessor. Many of the cardinals have called for a new pope who will be a good communicator, able to reach out particularly to young people.
Conclaves are usually only held after a pope dies and are sometimes decades apart -- the last one was in 2005, the one before that 1978. A popular Italian expression for things that happen very rarely is "at every death of a pope".
The 85-year-old Benedict broke with tradition, becoming the first pontiff to resign since the Middle Ages. He has said he will retire to a former nunnery inside the Vatican -- an unprecedented and delicate situation for the Church.
In one of his last acts as pope, he issued a decree allowing cardinals to bring forward the date of a conclave in cases of papal resignation -- a move seen by many as potentially setting a precedent for future ageing pontiffs.
The scandal of hushed-up sexual abuses of children by paedophile priests going back decades has also cast its shadow over the conclave.
The US group SNAP (Survivors Network of those Abused by Priests) called for over a dozen cardinals to be excluded from the conclave either for covering up abuses or making tactless remarks about the scandals.
The Vatican on Wednesday defended the cardinals and accused SNAP and other activists of showing "negative prejudices".
"None of us are surprised that they have tried to take advantage of these days to repeat their accusations and give them greater resonance," Lombardi said.
"These cardinals should be respected and have every right to be in the conclave," he said.