Police have named the man as Francisco Wanderley Luiz, who stood unsuccessfully in council elections for ex-President Jair Bolsonaro's Liberal Party (PL).
He was found dead outside the building shortly after two blasts rocked the area. Bystanders said they saw him throwing what appeared to be explosives before the detonation. Nobody else was hurt in the incident, officials said.
The area has been locked down and a bomb disposal robot is being used to search the man's body. Police say they have identified a timer possibly linked to other devices.
Brazil's solicitor general, Jorge Messias, denounced what he said was a deliberate attack and vowed a full investigation into the blasts.
"I strongly condemn the attacks against the Supreme Court and the lower house," he said in a statement posted to X.
"We must find out the motivation behind the attacks, and we need to re-establish peace and safety as fast as possible."
Police named the man as Francisco Wanderley Luiz. Local media report that he is from Rio do Sul, in southern Santa Catarina state, where he stood as a councillor for PL in 2020 but received just 98 votes.
Bolsonaro’s adviser, Fabio Wajngarten, wrote on X: “There are crazy people everywhere, across all political spectrums, supporters of all teams, of all beliefs and religions.”
Images carried by news agencies showed the deceased man lying in an area outside the Supreme Court vuilding, as officers cordoned off the area.
"The Military Police robot is searching the body of the individual who carried out the attack, and a timer was identified, and it is possibly linked to other explosives," said police spokesman Maj Raphael van der Broocke.
"Other explosives have already been identified around the body," he added. "We need to be very careful to carry out this search and, if necessary, detonate these explosives at the site to prevent them from causing a chain reaction."
Brasilia's Deputy Governor Celina Leão told reporters the explosion had occurred after a man approached the entrance to the Supreme Court and failed to gain entry. She recommended that parliament remain closed on Thursday while investigations continued.
“It could have been a lone wolf, like others we’ve seen around the world,” she told reporters, according to the AP news agency.
“We are considering it as a suicide because there was only one victim. But investigations will show if that was indeed the case.”
An eyewitness said she had seen a man waving at her before throwing explosives at the Supreme Court justice building.
“I was at the bus stop and this guy just waved hello and didn't say anything else," Lavana Costa told TV Globo.
"Then we heard the noise. I looked around at the noise and saw fire and smoke. The Supreme Court [STF] security guards came... He had already thrown something at the statue of justice.
"When the STF security guards were approaching, he threw something again. That's when it blew up and he fell to the ground.”
Earlier, the Supreme Court said in a statement that the building had been evacuated as a "precautionary measure" after explosions were heard. Justices had just finished hearing a plenary session and were quickly evacuated safely, it added.
The court is located in the Praça dos Três Poderes, or Three Powers Plaza, across the square from the presidential offices. Local media reported that President Luiz Inácio Lula da Silva had left the area shortly before the blasts.
The explosions come just a week before Chinese President Xi Jinping is due to visit the capital, following a trip to a G20 summit in Rio de Janeiro.
Last year, the plaza was the scene of mass disorder, after supporters of Bolsonaro ransacked the buildings days after President Lula had been sworn into office.