Rome authorities have urged pilgrims to stay away from the city centre, saying they cannot cope with any more before Friday's funeral of Pope John Paul II.
President George W Bush was one of the first foreign leaders to arrive
About one million people are waiting to see the Pope lying in state but the queue is now cut off to newcomers.
US President George W Bush has flown into Rome for the funeral, going immediately to St Peter's Basilica to pray before the body of the Pope.
Cardinals will begin the process of electing a new pope on 18 April.
About four million visitors have descended on Rome - which has a population of three million - since the pontiff's death on Saturday, said city police chief Achille Serra.
"The number of people is staggering and is growing constantly," Mr Serra told Reuters news agency. "This is unprecedented."
Some two million faithful were expected from Poland, the Pope's homeland, alone.
At its height, the tightly-packed queue of people wanting to see the Pope's body stretched back nearly 2km (1.2 miles).
Police formed a human chain around the end of the queue late on Wednesday to stop any more people joining it.
"Please, please, please, let me in," pleaded 21-year-old Alexandra Kramarczyk, just as the queue was closed. "We're Polish, he's our Pope."
The last in the queue will have more than 15 hours to wait before they reach St Peter's Basilica and the Pope lying in state.
Italian special security commissioner Guido Bertolaso said Rome was saturated with pilgrims and "can't take any more".
He warned that any new arrivals would have "no chance of following the funeral", and urged pilgrims already in Rome to go to Tor Vegata university campus, which is equipped to accommodate thousands of people.
He also asked those in tent cities on the outskirts of Rome to stay put and watch the funeral from video screens.
The gates of St Peter's Basilica will be closed from Thursday evening in preparation for the funeral.
Airspace over Rome is also closing, as tight security is put in force for the arrival of many foreign leaders.
Among the first to arrive was US President George W Bush, the first US president to attend a Pope's funeral.
Visiting St Peter's Basilica on Wednesday evening, he was joined by his wife Laura, his father the former President George Bush, former President Bill Clinton and US Secretary of State Condoleezza Rice.
The Vatican has announced that the cardinals of the Catholic Church will begin their conclave on 18 April.
FUNERAL GUESTS INCLUDE:
UN Secretary-General Kofi Annan
US President George W Bush
UK Prime Minister Tony Blair
Iranian President Mohammad Khatami
Brazilian President Luiz Inacio Lula da Silva
Palestinian Prime Minister Ahmed Qurei
French President Jacques Chirac
Taiwanese President Chen Shui-bian
DR Congo President Joseph Kabila
EU Commission President Jose Manuel Barroso
The process to elect a new pope will take place behind closed doors and could take more than a week.
Vatican spokesman Joaquin Navarro-Valls said the Pope's 15-page testament had been opened and read by the cardinals, but would not be published until Thursday.
Mr Navarro-Valls said the text, written in Polish, had not revealed the name of a mystery cardinal secretly appointed by the Pope in 2003.
Popes sometimes name cardinals "in pectore" (in the heart) and keep their names secret if revealing the identity would put them in physical danger.