Two young men have been arrested, charged and jailed in southern France after shocked Internet users watched a video of a suspected rape and alerted police.

Lawyer Francoise Nogues says the two men, aged 18 and 22, were charged on Tuesday with "aggravated gang rape" of an 18-year-old girl and "diffusion of pornographic images."

Perpignan prosecutor Achille Kiriakides said in a statement that the young men were jailed.

The prosecutor said the girl knew both men and that a barrage of analyses would help determine if the sexual encounters were "completely and freely" accepted.

The faces on the video — that has since been removed — were hidden by an emoji.

Nogues said her 22-year-old client told her the girl was his partner and was consenting.