A video broadcast by Spanish television stations showed the car crashing off the tree-lined road in a cloud of dust in the northwestern town of Carral during the A Coruna Rally.
"One of the cars in the rally left the road and ran down various spectators" as it sped around a bend about 8:00pm (1800 GMT), a spokesman for the Civil Guard police force told news agency AFP.
"We have confirmed that six people died, four woman and two men. One of them was a pregnant woman," said the spokesman, who asked not to be named.
He said about 20 people were hurt and several were taken to hospital, at least two of whom were "very seriously" injured.
The spokesman said authorities were investigating the crash.
The rally cars "go too fast for that kind of road. They are normal roads and people stand on the edge of the bend" to get a better view, he said.
Spanish media reported that the car was a compact Peugeot 206 XS and that children were among the injured. The drivers were not reported to have been hurt.
Spain's state Higher Sports Council said in a Twitter message that it "deeply regrets the accident in the A Coruna Rally. Our condolences to the families and friends of the deceased."
The event around the city of A Coruna in the Galicia region is a relatively minor race, not part of the World Rally Championship.
In March a co-driver was killed in the Mallorca Classic Rally after reportedly crashing into a tree on the Spanish island.