The exterior of the building where the incident took place.

A Spanish university dormitory said it had expelled several male students caught on video yelling vulgar threats at a female residence across the street that went viral on social media, sparking widespread national outrage.

In the footage, which Reuters has not been able to verify, one person first shouts from a window of Madrid's Elias Ahuja residence at the nearby Santa Monica all-girls dorm. "Whores, come out of your holes like rabbits, you are f****** nymphomaniacs," he says, also threatening to make the women submit at a "capea" - an outdoor party and amateur bullfight usually involving heavy alcohol consumption.

<p">Then, the video shows, dozens of the instigator's fellow residents turn lights on and open shutters to also shout and chant in a highly intimidating scene. "We cannot tolerate such behaviour that generates hatred and attacks women," tweeted Spain's Prime Minister Pedro Sanchez. "It is especially painful to see that the protagonists are young people ... Enough of machismo!"

Elias Ahuja is one of several private residences attached to the Complutense University of Madrid (UCM), Spain's biggest state university. Residents pay nearly 1,200 euros ($1,187) a month for room and board.