Hang Zhang, aged 25, who is a chinese national living in Hawley Street in the city centre, was arrested for possession of an offensive weapon in a public place after being found at the main gate of the palace on August 12.
He was later sectioned under the Mental Health Act.
During a hearing at Westminster Magistrates' Court on Thursday, prosecutors confirmed the charges against him had been dropped.
Chief Magistrate Emma Arbuthnot asked if it was due to his 'mental health problems'.
Rivelin Valley Road Sheffield: Body found after police search of Rivelin Valley
Hosepipe ban: Reservoir near Sheffield less than 15 per cent full as photos show how water levels have plunged
The Long Blondes: Leadmill cancel gig after allegations surface against band creator Dorian Cox
Yorkshire Water announces hosepipe ban as Government prepares to declare drought in UK
Sheffield businessman Rong Ren ordered to pay £1.1m by courts over phones scam
Prosecutor Emily Maunders replied: "Yes, I believe that is the case."
Mr Zhang had previously denied the charges against him during a hearing in October.