A trial has opened over the beating of two police officers and their girlfriends in northern Spain two years ago, a case surrounded by controversy because of the terrorism charges brought against the eight defendants.

Prosecutors say the fight at a bar in Alsasua in October 2016 should be treated as terror injuries and threats and judged as part of the long-standing Basque separatist campaign to oust Spanish security forces.

Supporters and defense lawyers say the charges are disproportionate for what they see as a bar brawl.

They also complain that three of the defendants have been kept in pretrial custody for nearly 18 months and reject the prosecutors' request for prison sentences ranging between 12 and 62 years.

Tens of thousands of people protested over the weekend in the northern city of Pamplona behind a banner with the slogan "Justice. It's not terrorism."