Codenamed Operation Spider, Spanish Civil Guard officers carried out 12 arrests in the Basque Country and Navarre and five others across northern Spain.
More arrests are expected in the following days, a police statement announced.
Most of the incriminating messages were posted on Twitter, relating in the majority of cases to the murder and kidnapping of victims of ETA, the radical Basque separatist group.
Here are some of the hate speech tweets:
“Shame there’s no more ETA for you to become the next Irene Villa (author and journalist who lost both her legs in a terrorist attack at the age of 12).”
“The best thing that could happen is that ETA take up arms again and eliminate the (ruling) Popular Party with bombs and shots in the back of the neck.”
“The murder of your loved ones brings us happiness and enjoyment”
“Miguel Angel Blanco (Popular Party politician kidnapped and murdered by ETA in 1997) would have his birthday on May 13th, but ohhh ETA stuck two bullets in his head, fuck him, let him rot.”
Since 1968, ETA has been held responsible for killing 829 people, injuring thousands and undertaking dozens of kidnappings.
The group announced a ceasefire in 2011.