A man involved in a shootout with Citrus County deputies Tuesday night died of a self-inflicted gunshot wound to the head, according to the medical examiner.

The shooting happened in the 6500 block of North Clayton Avenue at around 10 p.m.

According to deputies, David Barclay, 41, went to the home of his estranged wife to see his son. He was armed with a gun and forced his way into the home, authorities said.

Amanda Barclay, 34, and her 3-year-old son were home at the time. Barclay’s roommate was able to escape the home with her own 3-year-old child and call for help.

Deputies secured a perimeter around the home and the SWAT team was called in.

Deputies said Barclay threatened his wife with her life and fired multiple shots in the home; however, Mrs. Barclay was able to talk him out of his plans to kill her.

As Barclay exited the home, he encountered Citrus County deputies and fired at them, deputies said. After an exchange of gunfire, Barclay apparently took his own life.

Barclay did sustain injuries as a result of his exchange of gunfire with deputies, however, they were not life threatening.

FDLE continues their investigation into the incident. The Medical Examiner's final report is pending further investigation to include toxicology results.