Vietnam has detained 500 rioters after anti-China unrest in which more than a dozen factories were set on fire, police said Wednesday.