The man had early in the afternoon walked up to a large security tent outside the Oslo district court and sprayed himself, probably with a flammable liquid, before catching fire, a video published on the website of the Verdens Gang (VG) tabloid showed.
"Police officers pulled off his clothes and put out the fire," Kjell Jan Kverme, head of police security operations outside the courthouse, told AFP.
The man was seriously injured and taken to hospital, he added.
Police said the man was Norwegian of foreign origin and that the motives for his action remained unclear.
"We have no reason for the time-being to think this was linked" to the trial of Breivik, who was inside the courthouse when the man set himself ablaze, Kverme said.
The NTB news agency meanwhile reported the man was a 49-year-old desperate welfare client who had shortly before the incident gone to see his lawyer at her nearby office and, when it turned out she was not in, had left an envelope with the words "open if something serious happens to me" scrawled across the front.
When the lawyer returned to her office minutes after he left, she said she had smelled paraffin and had opened the envelope and found a letter rejecting his request for social aid inside, NTB reported.
In the VG video, the man can be seen running with his hat on fire and shouting "Shoot me! Shoot me!", before being tackled by police officers who tear off his burning sweater as he howls in pain on the ground.
Inside the courthouse, on the 19th day of Breivik's trial, young people wounded in his massacre were testifying about the shooting spree on the island of Utøya on July 22nd.
Breivik has been charged with committing terrorist acts when he bombed a government building in Oslo, killing eight people, before shooting dead another 69 in his rampage on Utøya.
The victims were there for a summer camp hosted by the ruling Labour Party's youth wing, and the youngest had just celebrated her 14th birthday.
The 33-year-old right-wing extremist has confessed to the killings but has refused to plead guilty, insisting the shootings were "cruel but necessary" to stop the Labour Party's "multicultural experiment" and the "Muslim invasion" of Norway and Europe.
Except for causing many of the journalists covering the trial to rush out, the man who set himself on fire did not disrupt Breivik's trial, which began on April 16th and is set to last until late June.
Ina Rangønes Libak, a 22-year-old, told the court about how she had survived multiple gunshot wounds on Utøya.
"I remember all the bullets that hit me. When I was hit in the arms, I thought: this is something I can survive. When I was hit in the jaw, I thought: this is more serious. Then I was hit in the chest, and I told myself: you can die from this," she recalled.
Libak had first hidden behind a piano in the cafeteria building where 13 people were killed, and was hit by at least four bullets.
"When you get shot that many times, you don't have enough hands to stop the bleeding," the young blonde said during her testimony, which drew both tears and smiles from onlookers in the courtroom.
Speaking in a clear, determined voice, Libak even made Breivik smile at one point when she recalled her satisfaction, in the name of gender equality, when she saw that the head of the rescue services that helped her on July 22nd was a woman.
While Breivik is expected to be found guilty, his 10-week trial will help determine the tricky question of his sanity and whether he will be sent to prison or to a mental institution.
If the court finds him sane, Breivik will face Norway's maximum 21-year prison sentence, but that term can be extended for as long as he is considered a threat to society.
If he is found criminally insane however, he will be sent to a closed psychiatric care unit for treatment -- a fate Breivik, who is intent upon showing that his anti-Islam ideology is not the ravings of a lunatic, has described as "worse than death".