An hourslong SWAT standoff ended Sunday afternoon after the suspect killed himself, according to the San Diego Sherriff’s Department.

The man had barricaded himself inside his home and had a gun, SDSO said, during the nearly 10-hour confrontation.

Deputies detained the man Saturday after being dispatched to his location for potentially having “mental health issues.”

The man was taken to Palomar Medical Center Poway following the incident.

Deputies determined the man had firearms and ammunition at his home, so they temporarily confiscated the weapons so the man wouldn’t harm himself.

The man was released by Palomar at some point between Saturday night and early Sunday morning.

The man returned home where deputies said there was a disturbance with his wife. At this point, he reportedly had a gun.

Deputies arrived at the scene on Poway Road just after 3:15 a.m.

Watch Commander: There is a suicidal, armed/barricaded subject in the area of 14000 Poway Rd. No one is currently in danger but please remain clear of the area. Poway Rd. is closed between Garden Rd. and Sudan Rd. We will provide updates as more information becomes available. — San Diego Sheriff (@SDSheriff) February 17, 2019

A SWAT team was then called in at around 6:45 a.m.

There were no hostages, according to SDSO, and officers said that “no one is currently in danger.” Poway Road between Garden Road and Sudan Road, however, was closed as a precaution.

In a tweet at 10:02 a.m., SDSO said the Crisis Negotiation Team was on scene to talk with the suspect.

Watch Commander: Barricaded subject in @cityofpoway update: (SED/SWAT) and Crisis Negotiation Team (CNT) Deputies are on scene. Please do not put the lives of deputies at risk by posting video or photos of their positions LIVE on TV, web or social media during this incident. — San Diego Sheriff (@SDSheriff) February 17, 2019

Just before 1 p.m., deputies said the standoff had ended. The man died by suicide, according to SDSO.

Roads in the area were reopened shortly after.