Click here if you are unable to view this gallery or video on a mobile device.

OAKLAND — A man arrested Wednesday night in the shooting earlier in the day of a 4-year-old boy who was wounded in the head at a residence in East Oakland is the boyfriend of the child’s mother, police said Thursday..

Police identified the man as Terrence L. Wilson, 37, of Oakland. According to Alameda County jail records, he was booked on suspicion of child abuse causing great bodily injury, criminal storage of a firearm, felon in possession of a firearm and possession of stolen property, all felonies. He was being held at Santa Rita Jail on $180,000 bail and is due to be arraigned in court Friday.

It was not immediately know what his prior felony conviction was for.

The boy’s mother, who was detained at the scene along with Wilson, was released pending further investigation, police said.

The boy remained in critical condition Thursday at a hospital. His name has not been released by police.

On Wednesday, police said dispatchers received a call at 2:02 p.m. from someone saying the boy had been shot at a home in the 2400 block of Ritchie Street, a residential area not far from Arroyo Viejo Park.

Police have not yet said if the shooting was accidental or who was handling the gun when the boy was shot. A pistol was recovered from inside the home, police said.

A man at the scene, Anthony Wilson, identified himself as the brother of the detained man and spoke to media outside the home, saying he had been told “the little boy went in the back of the room, crawled under his bed and then they heard the gun go off.”

Wilson, who said the child was visiting and did not live there, added that he did not know why the gun had been there.

“It’s supposed to be locked up, everyone knows that. Now, the situation, I don’t know why it wasn’t locked up,” he said. “I wasn’t here. I ain’t been here. I can’t tell you why the gun wasn’t locked up. I can tell you it was an accident.”

The incident is the city’s second shooting this month involving a child and an apparently unsecured gun.

In the first shooting, authorities had said a 23-year-old security guard faces prosecution on felony charges alleging that his unsecured pistol was the gun that fired a shot that hit his 3-year-old cousin in the face March 15 at their East Oakland home. That child underwent surgery at a hospital last week, and was hospitalized in stable condition.

Multimedia journalist Ray Chavez contributed to this report.