EL PASO, Texas (KTSM) – An El Paso man accidentally shot his infant “stepson” while putting a handgun away on June 18, court documents said.

Jesse David Gonzalez, 31, was taken into custody Monday and booked into the El Paso County Detention Facility on manslaughter charges after the 10-month-old child died hours after the shooting.

The shooting happened after a night of drinking, as Gonzalez was checking to see if the gun was loaded and it went off, hitting the baby in the head. The child had been placed on a bed as Gonzalez went to put the handgun and an AK-47 rifle away, the affidavit said.

Earlier in the day, Gonzalez’s girlfriend had moved both guns from underneath their mattress to the top of a bunk bed as she moved the beds around the room.

Later Gonzalez, his girlfriend and her three children went to Gonzalez’s mother’s house, where he allegedly drank four beers and a shot of liquor before going back home, the court documents say.

When they got home the girlfriend asked Gonzalez to go inside and put the weapons away before they brought the other children inside. That is when Gonzalez put the baby on the bed, “located directly next to the bunk beds where his handgun and rifle were.”

“The Defendant stated that he held the gun in his hand and checked to see if the handgun was loaded prior to putting the gun away,” the affidavit said. “The Defendant stated the handgun went off accidentally and that he and (his girlfriend) immediately noticed that the (infant) still laying on the bed was bleeding.”

The couple started driving to the hospital but when Gonzalez saw two marked El Paso County Sheriff’s Office vehicles, he flagged them down. Deputies administered first-aid and called an ambulance.

Two hours and a half hours later the child died, the sheriff’s office said.

According to the affidavit, Gonzalez is facing manslaughter charges because he admitted to drinking alcohol and “his mishandling of the firearm, that was pointed in the direction” of the baby. Deputies determined he “recklessly” caused the baby’s death.

Last week, the sheriff’s office publicly announced Gonzalez was wanted on a warrant. On Monday, they said he had been taken into custody. A family member of Gonzalez said he turned himself in at the El Paso County Courthouse with the help of his lawyer.