Image copyright Getty Images

Miley Cyrus has responded angrily online after apparently being grabbed by a stranger in Barcelona.

The singer, writing on Twitter, said: "She CAN'T be grabbed without her consent."

A video posted online appears to show a fan grabbing the singer by the neck before trying to kiss her.

Miley's reaction seems to have been a direct response to some social media users who suggested her lyrics or what she wears made her a deserving target.

Image copyright Twitter/mileycyrus

The Wrecking Ball singer and her husband Liam Hemsworth were being escorted to a waiting car by a security team when it happened.

A video of the incident appears to have been captured by Spanish Twitter user @AlvaroSaucedo13.

On Twitter Miley wrote: "She can be wearing what she wants. She can be a virgin. She can be sleeping with five different people.

"She can be with her husband. She can be with her girlfriend. She can be naked. She CAN'T be grabbed without her consent."

Image copyright Getty Images Image caption Miley Cyrus with her husband, Australian actor Liam Hemsworth

Miley reiterated the message on her Instagram stories, writing "#StillNotAskingForIt" over screenshots of comments from fans, including one which said: "You wanted to be 'sexy,' what did you expect?"

The former Disney star, who last month appeared at Radio 1's Big Weekend, is due to perform at Glastonbury Festival later this month.

She will also make a return to acting in an upcoming episode of Black Mirror which she's described as "outrageously out there and dark".

"This is the story of females in the music industry," she told Radio 1 Newsbeat.

"I understand everyone's gone through this but I do think for females in the industry… it's hard to be taken seriously.

"People assume that if you're not wearing a body suit and singing pop music, why would anyone want to see you?"

Follow Newsbeat on Instagram, Facebook, Twitter and YouTube.

Listen to Newsbeat live at 12:45 and 17:45 weekdays - or listen back here.