MADRID — A man accused of surreptitiously taking videos up the skirts of more than 500 women in Madrid has been arrested, the Spanish police said Wednesday.

The man, identified only as a 53-year-old Colombian living in Madrid and working in a warehouse, filmed women in the city’s subway system, on trains and in supermarkets, the police said. His arrest followed a lengthy investigation that the police began after running across a pornographic website that contained some of his videos.

The man filmed 555 women, at least two of them minors, according to the preliminary investigation. In some of the 283 “upskirt” videos that he posted online, he showed the women’s faces, investigators said. He searched for victims daily and “in a compulsive manner,” according to the police, once filming 29 women on a single day.