The mayor of a central New Jersey town is barring nonresidents from entering the community via a major highway — but it's just a temporary prohibition.

Belmar Mayor Matt Doherty announced the decision in a twitter posted around 3 p.m. Sunday. He says traffic into the town from Route 35 is "shut down immediately" because the Monmouth County community of about 6,000 people has "reached its capacity." Doherty says the decision was made for public safety reasons.

Thousands of people came to Belmar on Sunday for the concluding day of the 29th annual seafood festival or to hit local beaches.

Doherty says full-time Belmar residents can bypass the road closures by showing their driver's license.