Following a tense two-hour standoff, Edgartown police yesterday arrested a 38-year-old man who had barricaded himself inside a home on Whaler’s Walk while brandishing a handgun, threatening to kill himself and also shoot the team of police officers who responded to the scene.

Arthur Scott Smith was taken into custody around 2 p.m. on Thursday and charged with assault and battery with a dangerous weapon. At press time yesterday, police were in the process of obtaining a search warrant for the Whaler’s Walk home where Mr. Smith was renting a room.

Edgartown police Lieut. Tony Bettencourt said the investigation is ongoing and Mr. Smith could face additional charges.

The incident began just after noon when Edgartown police received a call from the county communications center about a suspicious male with a weapon at 105 Whaler’s Walk.

Several officers responded to the scene and observed through a window a male — later identified as Mr. Smith — holding what appeared to be a long-barreled pistol, according to police.

Police immediately called in the Martha’s Vineyard Tactical Response Team, a specially trained group that includes police officers from the six Island towns, state police and the Duke’s County Sheriff’s department. Police closed down the entire Edgartown Meadows subdivision to vehicles and pedestrians.

Lieutenant Bettencourt said police did not know at first if anyone else was in the home with Mr. Smith. “All we knew was there was someone inside with a gun who was capable of doing harm to himself or someone else,” he said.

Police spoke to Mr. Smith through an open window, and at one point he reportedly said: “I have a gun, go ahead and shoot me.” Police continued to communicate with Mr. Smith using the public address system on their cruiser, and at one point talked to him by cell phone.

During one of these conversations, Mr. Smith reportedly told police: “If I come out, I’m coming out blasting.”

Mr. Smith came out of the house several times with the pistol in his hand and on at least one occasion pointed the weapon in the direction of the officers. After two hours of negotiations, he agreed to come out peacefully, and was taken into custody without incident.

Lieutenant Bettencourt praised the tactical response team for safely defusing a volatile situation.

“There is no question they were a huge help at resolving this without someone getting hurt. They’ve all been trained to respond to these types of situations, and they did a great job,” he said.

Mr. Smith was expected to be arraigned in Edgartown district court this morning.