Pretoria - A last few groups of people were let into the Union Buildings around 5pm on Friday to view the body of former president Nelson Mandela lying in state.
Earlier, a number of people rushed through a police line when the gate was reopened to the public at 4.20pm after being shut earlier.
Police quickly regained control of the situation and people then entered calmly in ones and twos.
Earlier in the afternoon, police locked the Government avenue gates leading to the Union Buildings after the government said capacity had been reached for the day.
However, once word spread that they had been reopened, crowds began queuing again.
The third and final day of the public viewing of Mandela's body is scheduled to close at 5.30pm.
Park-and-ride facilities had already closed by mid-morning, by which time tens of thousands of people had made their way to the Union Buildings.
There was almost a stampede by thousands of people at the Tshwane Events Centre when they found out no more transport would be provided.
People tried to force their way through the gate, and a seven-year-old child fell and was almost trampled by the angry crowd. She was rescued, unharmed.
The City of Tshwane said over 20 000 people queued on Thursday for a chance to pay their last respects to Mandela.
Acting government communications spokeswoman Phumla Williams said in a statement that between 12 000 to 14 000 people viewed the body on Wednesday.
She estimated that two people every three seconds were filing past Mandela's coffin.
On Friday, several memorial services were taking place throughout the country to honour the former president.
Mandela died at his home in Houghton, Johannesburg, last Thursday, at the age of 95.
His body will be taken to the Eastern Cape on Saturday, and he will be buried on Sunday in a state funeral in Qunu, where he spent much of his childhood.