A man who allegedly opened fire on officers attempting to arrest him on a warrant in Middleborough has killed himself following a hours-long standoff with police, officials said.

Around 9:30 a.m., a man described by police as a wanted fugitive allegedly shot at officers with a long rifle as they attempted to execute an arrest warrant at 469 Wareham Street, Middleborough police said.

No officers were struck by the gunfire.

Police withdrew and established a perimeter around the house, issuing a shelter in place order for residents on nearby streets. For over seven hours the suspect remained barricaded within the home, as members of the Southeastern Massachusetts Law Enforcement Council SWAT Team and a State Police helicopter provided support to local officers.

Police made several efforts to contact the man in an effort to resolve the standoff peacefully, Middleborough Police Chief Joseph Perkins said at a press conference Wednesday afternoon. But those effort proved unsuccessful.

Shortly after 5 p.m., Middleborough Police confirmed that the suspect, described as a white man in his 30s or 40s, had killed himself, ending the standoff.