The incident took place between 5.30 pm and 7.30 pm on Thursday evening in Kiel, the capital of Germany's northernmost state, Schleswig-Holstein.
As the teenagers aged between 15 and 17 went for dinner together, they were followed by two young men, both from Afghanistan, police report.
The two men then started filming the girls with their phones as they sat in a restaurant near the harbour.
According to statements the girls gave police, the men then appeared to send the video or pictures to other people.
Within a few minutes a group of up to 30 men had arrived at outside the restaurant.
Two of the girls ran from the restaurant at this point and managed to shake off a group of around ten men who followed them.
But when they returned to look for their friend, two men sat next to them and began again to harass them.
According to the current investigations none of them men attempted to physically assault the girls.
Police were alerted by other customers at the restaurant. When officers took four of the men in to check their identities, the men resisted and have been charged with attempted grievous bodily harm.
A spokesperson for the police in Kiel explained to The Local that they came to the scene on suspicion that two men were threatening other restaurant patrons and would not stop.
The other two men are being investigated for their attempts to commit violence against law enforcement officials.