The mayor of a New Jersey shore town temporarily barred nonresidents from entering the community via a major highway Sunday because the town reached its “capacity,” the mayor tweeted.

Belmar Mayor Matt Doherty announced the decision in a tweet posted around 3 p.m. Sunday.

Doherty said traffic into the town from Route 35 was "shut down immediately" because the Monmouth County community of about 6,000 people has "reached its capacity" -- about 200,000, according to official estimates. Doherty says the decision was made for public safety reasons.

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

"They would have come into town driving their car with no place to park, no place really to drive and they probably would not have made either the beach or the seafood festival anyway," he told NBC 4 New York Monday.

"It was just too many people," said resident John Cherekjian. "That was it, it was just too many people."

It was a banner day for businesses like Jimmy's Pizza, where the line ran out the door all day.

"We did run out of food," said Tracy Latham. "By Sunday night, we ran out of a lot of things."

Full-time Belmar residents were able to bypass the road closures by showing their driver's license.

Route 35 was reopened around 7 p.m. Sunday. Because the event was peaceful and there were no arrests, the mayor said he sees traffic as the only challenge in the future -- something he said will be addressed.