The man, who was barefoot, managed to climb to a site where foreign delegations are received. He said that he wants to marry Rousseff, 64, and claimed he had already been her husband before.
Presidential guards had to open fire from rubber-bullet guns to calm the man down.
He was sent to a hospital in the country’s capital Brasilia and will later be questioned over the incident. A photograph of Rousseff was found in the man’s pocket.