A police standoff came to peaceful end in New Jersey Sunday after a man barricaded himself inside a home and allegedly fired at officers.

SWAT teams surrounded the home for hours following a motor vehicle stop on the Kennedy Boulevard border of North Bergen and West New York. Authorities said the suspect abandoned his car and fled to the home.

Dozens of residents who live nearby were evacuated as a precaution while authorities worked to negotiate a peaceful conclusion.

The man reportedly had prior military experience.

Later Sunday, the Hudson County prosecutor tweeted that the suspect surrendered after nearly 12 hours. Officials said the standoff ended after police negotiators, the man's relatives and the town's mayor convinced him to surrender.