They were hoping to be the last of some 50,000 people to pass through the Union Buildings on Friday, where the former president’s body has lain.
Officials say at least 100,000 people have visited the venue over the past three days to pay their respects.
Nelson Mandela’s coffin was taken from the building shortly after doors closed.
The coffin was escorted by a guard of honour to a waiting hearse as military helicopters circled over the city.
Nelson Mandela’s body will remain in Pretoria overnight, and there will be a ceremony at a local air force base on Saturday morning to allow members of the governing African National Congress to say a last farewell.
The coffin will then be flown to the Eastern Cape ahead of the burial at Nelson Mandela’s ancestral home in Qunu on Sunday.
The funeral will mark the end of a period of commemorations in South Africa since Nelson Mandela died at 95 on December 5.
“The third day closed with over 50,000 paying their respects to our national icon and first democratically elected President of our country,” the South African government said in a statement.
Shortly before the lying in state came to an end, at 17:45 local time, hundreds of people towards the front of the queue pushed through in the hope to be one of the last through the door.
One police officer told the AFP news agency: “There are too many people. The whole of the Republic of South Africa wants to say goodbye.”
Many people waited in the line for 11 hours for the chance to see Nelson Mandela’s body.
Some were angry more time had not been allowed for this ceremonial; others said even if they could not reach Nelson Mandela’s coffin for a personal farewell it was enough simply to be there.
WOHMiEgmWZwImage source: Wikimedia Commons President-elect Donald Trump celebrated his election victory at the Ultimate Fighting…
Millions of voters across the US chose to return Donald Trump to the White House…
Donald Trump declares victory in the US election as he addresses jubilant supporters in Florida.…
Stocks around the world are rising as Donald Trump appears to be on the cusp…
Donald Trump has won Pennsylvania, North Carolina and Georgia and taken a lead over Kamala…
Quincy Jones, the celebrated musician and producer who worked with Michael Jackson, Frank Sinatra, Ray…