Nacho Minguez, head of Vox in Madrid, staged the event in June - which was not the first time a giant Spanish flag was displayed in the overseas British territory, which Spain's government and nationalists want back from Britain.
The tiny territory on Spain's southern tip, governed by Britain since the 18th century, is the subject of frequent squabbles between the two nations.
According to court papers unveiled Wednesday, Minguez and Pedro Fernandez - a lawyer in charge of legal matters at the group founded in 2013 by ex-members of Spain's ruling conservative Popular Party - filed an official complaint for "alleged torture and crimes against moral integrity."
Minguez, who was arrested in Gibraltar on June 20th, alleges police kept him for more than seven hours, frisked him "in a disproportionate manner," stopped him from telling anyone where he was, denied him a lawyer and food, the court papers say.
Fernandez, meanwhile, says that when Minguez was brought to trial several days later, "he had not been able to talk alone with his assigned lawyer."
"This forced the suspension of the trial for several minutes in order for him (Minguez) to know what he was accused of," the court papers say, quoting the complaint.
Fernandez, who had gone to court to help Minguez, was also detained after he took photos of the courtroom, was frisked twice and held incommunicado for nine hours.
The complaint alleged that the police holding him "recognised that the treatment he and Mr. Minguez were being subjected to was due to political reasons and by direct order of the chief minister (head of Gibraltar)."
The National Court said it had accepted the complaint, which triggers an official investigation into the case.
Gibraltar's Chief Minister Fabian Picardo blasted the legal proceedings as "frivolous and vexatious."
"I fully respect the Spanish courts and legal system and will therefore not lose a moment's sleep over this case," he said in a statement.
"Lawyers will be instructed to deal with this clear abuse of process."