Updated at 1:36 p.m. with more details from sheriff's deputies.

A gunman killed himself, and a 2-year-old boy was rescued after an overnight standoff with Wilmer police and Dallas County sheriff's deputies.

The standoff began around 3 a.m. Wednesday in an apartment complex in the 5900 block of South Interstate 45 near Belt Line Road and ended just before 8 a.m., officials said.

When it was over, 24-year-old Marcus Williams was dead, Dallas County Sheriff's Department spokesman Raul Reyna said.

Williams' wife told deputies her husband was acting violently and firing a gun in the apartment. She grabbed her 1-year-old child and fled, calling 911 from a safe location, Reyna said.

Williams' wife said when she last saw her husband, he was barricaded inside a bathroom with the couple's 2-year-old son.

Tactical officers tried multiple times to talk to the suspect but were unsuccessful, Reyna said. They entered the apartment around 8:15 a.m. and found the child unharmed in the master bedroom and Williams dead from a self-inflicted gunshot wound, Reyna said.

Residents were evacuated about two hours before the standoff ended, Reyna said.