BRIDGEPORT — A New Haven man and a North Carolina woman were in custody Thursday in connection with a shooting at a Stratford hotel that nearly injured four young children.

Jerrod Goodman, 40, of Shelton Avenue, was charged with criminal possession of a pistol, illegal discharge of a firearm, reckless endangerment, carrying a pistol without a permit and four counts of risk of injury to a child.

Alize Tyler, 29, of North Carolina, was charged with hindering prosecution, possession of a weapon in a motor vehicle and interfering with police.

“These are very serious allegations,” Superior Court Judge Tracy Lee Dayton said during the arraignment hearing Thursday afternoon. “Four children were put in danger.”

She ordered Goodman, the owner of a trucking company, held in lieu of $250,000 bond and Tyler $25,000 bond and continued the cases to Oct. 15.

Shortly before midnight Wednesday, police said they got a call of a shooting at the Quality Suites on South Avenue. When officers arrived, they found guests evacuating the hotel.

Police said the hotel clerk directed officers to a second-floor room where they found a hole in one wall and a bullet lodged in the opposite wall just above a bed.

A man told officers he and his family had been asleep in the room when they heard a loud bang and a bullet struck the wall just inches over the bed where his four young children were sleeping, police said.

Police said the adjacent room where the shot had been fired was empty.

Officers noticed a woman later identified as Tyler sitting in the driver’s seat of a car running in the parking lot, police said. She said she was waiting for a friend. Police said officers found a rifle that appeared to have been recently fired wrapped in a towel in the car.

After being taken into custody, police said, Tyler told them she had traveled from North Carolina with Goodman and two others. After getting a room at the hotel, she said Goodman had taken the rifle from the trunk of the car, wrapped it in a towel and brought it to the room, according to police.

While in the room, police said Goodman began handling the rifle and it went off, firing into the wall. Goodman then allegedly directed Tyler to put the rifle back into the car, police said.

During a search of the car, police said they also found a backpack in some nearby bushes that Tyler said had been in the car.

Police said the backpack contained a .45-caliber handgun that had previously been reported stolen in Wyoming, $11,000 in cash, ecstasy pills and marijuana.