Four people have been arrested over the killing of a gay man over the weekend, Spanish police said on Thursday, a suspected hate crime that sparked nationwide protests.

Samuel Luiz, a 24-year-old nursing assistant, was out with friends in the northern city of Coruna in the early hours of Saturday when an argument started outside a nightclub.

His friends told Spanish media that Luiz was making a video call when two passersby accused him of trying to film them on his phone. When Luiz explained he was talking to a friend by video, he was attacked by one of the passersby, who left him with a badly bruised face.

Shortly after, the attacker allegedly returned with several others who beat Luiz unconscious. He was taken to hospital where he died from his injuries later on Saturday.

Police arrested a man in his early 20s on Thursday over his suspected involvement in the attack, a National Police spokesman said.

He is friends with three other suspects aged between 20 and 25 who were arrested on Tuesday after officers reviewed footage from surveillance cameras, the spokesman added.

The assailants shouted homophobic slurs while beating Luiz, according to his friends' version of the events.

Police have not yet deemed it a homophobic attack, a spokesman saying "all hypothesis are open".

Protesters demonstrate after the murder of a gay man in Spain. Photo: ShutterstockProtesters demonstrate after the murder of a gay man in Spain. Photo: Shutterstock

None of the four suspects knew Luiz, the spokesman added.

The attack coincided with Pride celebrations in Spain and sparked protests in cities including Madrid and Barcelona on Monday night to demand better protection for gay people.

Demonstrators carried signs with slogans including "what they call you while they kill you matters".

Socialist Prime Minister Pedro Sanchez condemned the killing, calling it a "savage and merciless act" in a tweet.

Sign up to our free newsletters

Get the best updates straight to your inbox:
Please select at least one mailing list.

You can unsubscribe at any time by clicking the link in the footer of our emails. We use Mailchimp as our marketing platform. By subscribing, you acknowledge that your information will be transferred to Mailchimp for processing.