A 9-year-old boy showing off a handgun on his school bus Friday accidentally shot another student in the elbow, authorities said.

The 11-year-old victim was hospitalized in good condition.

The bus was arriving at Longfellow Elementary School at 8:20 a.m. when the .38-caliber handgun fired, Los Angeles County Deputy Sheriff Oscar Butao said.

"The other student was showing the handgun to his friend, and it accidentally went off," Butao said. "The driver just heard a gunshot."

The youngster with the gun was taken into custody and was being questioned by detectives. Both boys are special education students, authorities said.