(CNN) -- The security guard suspected of killing a 16-year-old American student in Costa Rica has been charged with simple homicide, authorities said Friday.

The suspected gunman worked as a guard at the hotel where the boy was staying in La Fortuna, a popular tourist spot famous for the Arenal volcano.

The boy and three others left their rooms after curfew Wednesday night and went to another section of the hotel to visit some friends, according to Marisel Rodriguez, spokeswoman for the Judicial Investigation Organization (OIJ), which investigates crime in Costa Rica.

Around 4 a.m. on Thursday, the boys attempted to go back to their rooms, cutting across a wooded area of the hotel grounds, she said.

The security guard saw them, apparently mistook them for robbers and fired his weapon, said Rodriguez.

The 16-year-old was shot in the chest and died. He was identified by the McLouth, Kansas, school district as Justin Johnston.

Johnston was on a nine-day trip in Costa Rica with this school's Spanish club when he was killed, the school district said. No other students were injured.

Family and friends of the boy gathered for a prayer service at a church across the street from his school.

"It's heartbreaking," Zack Willard told CNN Kansas City affiliate KCTV.

"You don't really know what to think right now being told this. He's one of my good friends. He was a very good kid. He always did good. He loved sports. He was just an all-around good kid," Willard said.

Simple homicide in Costa Rica is the equivalent of manslaughter in the United States. The guard did not have a permit to carry his gun, as required by national law, said Rodriguez. He will be incarcerated until his trial, she said.

CNN's Nick Valencia and journalist Irene Rodriguez contributed to this report.