A Massachusetts police detective caught on video threatening to "put a hole" in a motorist's head has resigned.

Medford Mayor Michael McGlynn's office confirmed Tuesday that Detective Stephen LeBert had left the police force. LeBert's attorney says it was a difficult decision for him.

LeBert was off duty and out of uniform on July 26 when he stopped a driver who had made a wrong turn into a rotary and almost collided with another vehicle.

A dashcam video later posted online shows LeBert telling the driver, "I'll put a hole right through your head." It shows him repeatedly using profanities even as the driver tries to apologize.

The detective had been on administrative leave since the outburst. His record included several prior disciplinary actions.