A Farmington woman killed herself Monday at her Twin Ponds Circle townhome during an hours-long standoff with police.

Farmington police responded at 3:20 p.m. after the woman’s mother and friend said she was threatening suicide and had a handgun.

When officers opened a window and called out to identify themselves, the woman yelled, asked police to leave and threatened to shoot her gun.

The woman then shot at police, said Farmington police Det. Shawn Scovill.

A Dakota County SWAT team, a crisis negotiation team and other officers formed a perimeter around the home. Scovill said intermittent text messages from the woman stopped about 6 p.m.

Two remote-control robots were deployed into the residence, and video showed the woman dead from an apparent self-inflicted gunshot wound, according to police.