Mr Mandela’s body was lying in state at the government buildings where he was sworn in as South Africa’s first black president in 1994.
Among those paying their respects were his widow Graca Machel, President Jacob Zuma, celebrities including Bono and other relatives and officials.
Mr Mandela died last Thursday at the age of 95 and will be buried on Sunday.
They came in wheelchairs and pushchairs – black, white and everything in between. Some broke down in tears and needed to be supported; others were just subdued. There was certainly no singing.
I met an Asian and a black family who had made friends while waiting for hours in the queue for the buses coming to the Union Buildings.
Some said that seeing the body meant they could accept their tata, or father, had really gone. Thobeka Mohlahlo came with her two young children and so did not actually see the body, but “just being here helped”. A white soldier was helping her by carrying one of the children towards the bus. Nelson Mandela would be proud how far his rainbow nation has come.
His funeral will take place in his home village of Qunu in Eastern Cape province.
Tens of thousands of South Africans joined scores of world leaders for a national memorial service on Tuesday, as part of a series of commemorations.
The former president’s grandson, Ndaba Mandela, said his grandfather would have been touched by the way his death had united people all over the world.
“I think he would have been completely humbled by it, to see so many people just share their love, their appreciation, just the sense of appreciation that he has given them,” he said.
Patience of the crowds
People queued in various parts of the city for the chance to see Mr Mandela’s body.
Thousands managed to gain entry, but the BBC’s Peter Biles in Pretoria says hundreds more were turned away before public viewing ended at 17:30 (15:30 GMT).
Mr Mandela’s coffin will be lying in state for two more days, so the disappointed can try again on Thursday or Friday.
Our correspondent says those queuing have shown enormous patience with the lengthy process of gaining admission, which involves stringent security checks.
Earlier, crowds watched as the coffin was taken in procession from a hospital mortuary to the Union Buildings.
Mr Mandela’s widow Graca Machel was among those who filed past his coffin on Wednesday
South Africans queued for hours to get a glimpse of their hero
Small crowds had already gathered as the coffin was driven through Pretoria on the way to the Union Buildings
The mood was celebratory rather than sombre in most places
The procession left the city’s 1 Military Hospital shortly after 07:00 on Wednesday.
The coffin could be seen inside a black hearse, draped in a South African flag, in a convoy with military outriders and ambulances.
Mr Mandela’s remains will make the journey from the military hospital every morning from Wednesday until Friday,?the government announced.
“The public are encouraged to form a guard of honour by lining the streets,” it said.
Crowds cheered and sang as the convoy sped past.
“Seeing him passing by was the greatest thing I have ever seen in my life. I just wanted to see him passing for the last time,” said one mourner, Grace.
Meanwhile the government has been criticised over several mistakes in its handling of Mr Mandela’s memorial service on Tuesday.
- Deaf viewers claim that the official?sign language interpreter was inept, with signs that were “arbitrary” and “did not make sense”.
- There were also difficulties with transport: dozens of trains that had been reserved to take people to the stadium were delayed due to power failures.
- The South African newspaper City Press alleged that the state broadcaster SABC instructed its production staff to cut away from live footage of President Jacob Zuma, because he was being booed by sections of the crowd. SABC has denied the allegation.
Lying in state
- Nelson Mandela’s body lies in state at the Union Buildings in Pretoria 11-13 December
- Coffin taken every morning from the mortuary to the Union Buildings
- Public encouraged to line the route
- Mandela family and selected visitors viewed the body from 10:00 on Wednesday; open to public from midday
- The public will then be able to view the body from 08:00 to 17:30 on Thursday and Friday
Ndaba Mandela told the BBC that his grandfather would not have been bothered by the booing.
“He is a man of the people and one who respects and understands that the people must express their opinions no matter whether they are with you or against you,” he said.
But presidential spokesman Lindiwe Zulu said the booing was “humiliating” and those responsible would be “dealt with”.
One of the dignitaries at the memorial event, former Archbishop of Cape Town Desmond Tutu, had his?home broken into?while he was away, an aide has told reporters.
After Mr Mandela’s body has lain in state for three days, the military will fly him to the Eastern Cape from Air Force Base Waterkloof in Pretoria.
A military guard of honour will welcome the arrival, and the coffin will then be placed on a gun carriage and transported to a hearse.
“Mr Mandela’s body will then be taken to his home village of Qunu, where the Thembu community will conduct a traditional ceremony.
A national day of reconciliation will take place on 16 December when a statue of Mr Mandela will be unveiled at the Union Buildings.
Big screens have been set up across South Africa to show the planned national events.