JOHANNESBURG, South Africa (AP) _ A white African National Congress guerrilla who pleaded guilty to treason and arson charges and admitted she bombed police stations was sentenced today to 25 years in prison.

''Had lives been lost, you would almost certainly have received the death sentence,'' Justice P.J. Van der Walt told Marion Sparg as he passed sentence on her.

As Van der Walt pronounced sentence, some spectators in court shouted, ''amandla,'' the Zulu word for ''power.''

Miss Sparg, 28, a former reporter, pleaded guilty Monday in Rand Supreme Court.

She admitted she planted limpet mines at three police stations early this year, causing two explosions, and said she took part in gasoline-bomb attacks in 1981 on offices of the opposition Progressive Federal Party.

The prosecutor had asked for life imprisonment. Miss Sparg's attorney, Jules Browde, asked for mercy, saying his client considered herself a soldier and patriot.

Van der Walt described Miss Sparg as a dedicated and unrepentant member of the ANC's military wing.

''The fact that as a white South African you chose to espouse the cause of revolution I regard as an aggravating feature,'' the judge said.

Miss Sparg told police the mines were aimed at ''structures'' of apartheid, and that she believed she acted on behalf of most blacks and an increasing number of South African whites.

The outlawed ANC is the main black guerrilla group fighting apartheid, under which South Africa's 24 million blacks are denied a voice in the national government. The country's 5 million whites control the government and economy and maintain separate residential areas, schools and health facilities.

Throughout the trial Miss Sparg wore a black suit with a green shirt, and today she completed the ANC colors by wearing a yellow ribbon. A sympathizer handed her a yellow scarf and bouquet of yellow chrysanthemums.

After the sentencing, Miss Sparg hugged and kissed members of her family, who cried as she was led away.

Three white women previously have been convicted of treason. Most recently, Helene Passtoors, a 44-year-old Dutch-Belgian linguistics student, pleaded guilty to aiding the ANC and was sentenced last May to 10 years in prison.

Her former husband, Klaas De Jonge, was arrested with her but escaped from police and has taken refuge in the Dutch Embassy in Pretoria.

Barbara Hogan was convicted of treason in 1982 for joining ANC and promoting their policies. She also was sentenced to 10 years in prison.

Johanna Lourens, 23, was sentenced in 1983 to four years in prison because she had not reported the activities of her fiance, who was convicted of being an ANC member.