Two Milwaukee men have been arrested after a 5-year-old who accidentally shot himself with a gun died on Tuesday, authorities said.

The incident happened just before 8:30 p.m. in the 900 block of South 29 Street, Milwaukee police said.

The boy, identified as Elijo Gonzales, was rushed to a local hospital, where he later died, FOX6 Milwaukee reported. 

Police said a 35-year-old man and a 58-year-old man were arrested for leaving a firearm unattended. The relationship between the child and the two men was not immediately clear.

ANOTHER 6-YEAR-OLD CAUGHT WITH HANDGUN AT SCHOOL, MOTHER CHARGED: REPORT

street of home where child shot himself

Police said the child shot himself just before 8:30 p.m. in the 900 block of South 29 Street in Milwaukee. (FOX6 Milwaukee WITI)

Criminal charges against the two men were being referred to the Milwaukee County District Attorney’s Office.

Milwaukee Mayor Cavalier Johnson called the boy's death "extremely upsetting" on Twitter.

"Please make sure to secure your guns in a gun safe, with a gun lock, and out of the reach of children," the mayor wrote.

VIRGINIA PROSECUTORS TAKE CASE OF BOY, 6, WHO SHOT TEACHER IN CLASS: POLICE

Gonzales was a student at Seeds of Health Elementary School, school officials confirmed to the station.

Wisconsin crime graphic

Milwaukee police said the criminal charges against the two men will be referred to the county district attorney's office. (FOX News)

CLICK TO GET THE FOX NEWS APP

"Elijo was a charismatic, energetic student who loved learning and was a source of joy to his family and friend," the school said in a statement. "Our sympathies go out to our families and the community as we deal with this loss.