MILFORD >> The Board of Aldermen Monday night approved an ordinance for bicyclists that prohibits dangerous weaving or zigzagging and gives local police the right to impound a bike for violation of the rules.

The three-page measure is modeled largely after the state’s rules governing cyclists, but with those two twists.

It was brought about because of increasing complaints of young bicyclists — many believed to be middle school age — cutting into traffic, doing tricks on sidewalks and generally interfering with pedestrians and motorists. The city previously had no ordinance governing bicycles.

Milford police Capt. Alex Opoulos said the tricks are getting more daring in part because young bicyclists are posting their antics on social media and trying to one-up each other.

In addition to coming from Milford, many riders are from Stratford and West Haven, as they often travel into each other’s communities.

Opoulos said school resource officers in Milford have found it effective to identify some riders through video or photographs and have a talk with them in school about riding safely.

He said 10-20 years ago skateboards were disrupting the calm downtown, and now it’s bicycles.

Impounding the bikes of those who break the rules should resonate with young people because the parents of those under 18 will have to get involved to get back the bikes. Those who break the rules also can be ticketed, he said.

Opoulos said those who may face a juvenile charge will get the chance to enter Milford’s diversion program, rather than appear in Juvenile Court in New Haven.

The program involves a talk with a detective and a parent session. The “second chance” program in general is quite successful, he said.

Alderman Raymond Vitale, an avid cyclist, emphasized the importance of educating young bicyclists and said he would see what could be done through the Milford Prevention Council.

Under the ordinance, proper, safe riding with rules is permitted on sidewalks, although one alderman suggested — then withdrew the suggestion — that bicycling be eliminated on sidewalks.

Mayor Benjamin G. Blake, father of three young children, said it wouldn’t be a good idea because little ones can’t ride safely in the road. Some municipalities have bans on riding bicycles on sidewalks, officials said.

Aldermanic Majority leader Nick Veccharelli Jr. said some cyclists are “being lawless and frightening our community.”

He talked about extreme bicycle gangs scaring women getting out of their cars and in other situations, although that is not the predominant problem with the cyclists in Milford.

In response to a question about city liability and whether that is one of the reasons for the ordinance, City Attorney Jonathan Berchem said it was not, but noted that if an accident were to occur between a car and a bicycle, the motorist would be open to a lawsuit.

Some aldermen expressed dismay that young people have taken everything to extremes and don’t exercise the kind of common sense they knew as kids.

Alderman Frank Smith got a laugh when he said if he had his bicycle impounded as a kid and needed his parents in order to retrieve it, he still wouldn’t have it back at 62 years old.