Four teens were arrested after they allegedly started having sex at a Cape Cod beach on the Fourth of July.

Dennis police said an officer was on patrol on an ATV at Mayflower Beach just after 1:30 p.m. Tuesday when the officer learned there were four people who were "acting inappropriately in the water." A witness said they were having sex.

By the time the officer arrived, a large crowd on the beach had gathered around the four people, and some were expressing their shock about the situation, according to police.

Eventually the four people were arrested for disorderly conduct after the officer and beach staff tried to get their attention. Additional officers had also arrived at the scene. Witness video of the arrest shows all of the accused in handcuffs with police at the scene.

The names of those arrested were not released, but they were identified as a 19-year-old male, a 19-year-old female, an 18-year-old female and a 17-year-old male.

After they were arrested, another teen identified himself to police as their friend and allegedly tried to approach his friends who were in custody, defying the officers' orders to leave. The 19-year-old was also arrested on a disorderly conduct charge.

All of the arrested individuals were bailed or released. The 19- and 18-year-olds will be arraigned on Tuesday, while the 17-year-old will be arraigned at a later court date.