A 7-year-old boy jumping on a trampoline with friends was killed by a stray bullet, and a man living two houses away was arrested, authorities said.

The boy was playing with four or five other children Tuesday night in a back yard near Uhland when they heard gunshots, Hays County sheriff's spokesman Leroy Opiela said. He said the boy, whose name was not released, was hit in the back and died shortly after reaching an Austin hospital.

Deputies searched the neighborhood after the shooting and arrested Jose Barrera Espitia, who lives two houses from where the boy was playing, authorities said.

They found a .22-caliber rifle they believe was the source of the shot, though it wasn't clear why Espitia would have been firing the gun.

Espitia, 37, was charged Wednesday with second-degree manslaughter. No bail was immediately set.

Uhland is a small community of about 400 residents 25 miles south of Austin.