Police operations leader Finn Belle told The Associated Press that the man doused himself in a flammable liquid and set himself on fire outside the entrance to the building.
"There were police officers on site and the fire was put out quickly," Belle said. "The man received burn injuries and was transported to Oslo University Hospital."
He said the man's identity and the motive for his actions were not immediately clear.
Police spokesman Kjell Jan Kverme told Norwegian broadcaster NRK that police believe he is a Norwegian citizen "but we don't yet know his identity to 100 percent. He is seriously injured. He has wounds on his chest and stomach."
Asked whether the incident was connected to the trial against Breivik, that has been going on since mid-April, Belle said, "One would think there is one connection or another but we don't have any information on that."
Norwegian newspaper VG posted a video clip on its website showing a man running toward the security checkpoint outside the courthouse with flames shooting up from his hat. Another sequence showed police officers tending to him on the pavement outside the checkpoint, removing his burning sweater.
Breivik has admitted to setting off a car bomb that killed eight people outside the government headquarters in Oslo and then killing 69 people in a shooting rampage at the Labor Party's annual youth camp. He has shown no remorse for the attacks, saying the victims had betrayed Norway by embracing multiculturalism.
The fire Tuesday was the first incident outside the Oslo district court since the trial began. Inside the court, an Iraqi man whose brother was killed in the massacre threw a shoe at Breivik last Friday, hitting one of Breivik's defense lawyers. That incident briefly interrupted the proceedings, which had been conducted without disturbances until that point.
The trial is scheduled to run until the end of June.