An Edgewater man who charged at a sheriff’s deputy with a sword and barricaded himself in his home was arrested after an eight-hour standoff during which police tried used a remote-controlled robot, a chemical agent, beanbag bullets and a taser.

At about 4:20 p.m. Tuesday, an Anne Arundel County sheriff’s deputy went to the 2700 block of Cassia Drive to serve a court order on Michael R. Beach, 44. When the deputy found him, Beach lunged at him with a sword, then retreated into his home, police said.

Over the next several hours, police unsuccessfully tried to communicate with Beach. They sent in a remote-controlled robot they used to try speaking with him, they said, but that didn’t work. Police said it was the first time they had deployed the robot camera.

At about 10:30, police deployed a “chemical agent” and went inside Beach’s home. They found him with a wound to his torso, still clutching the sword, police said. They fired beanbag rounds at him, but he was unaffected, police said.

He retreated into the bathroom, and at 12:30 a.m., police used a taser on him and took him into custody. He had a self-inflicted wound, police said and was taken to an area hospital.

Beach has been charged with intent to murder in the second degree, assault, reckless endangerment and related counts.