A boy who brought a loaded gun to an elementary school planned to shoot a principal who had disciplined him, authorities say.

The 12-year-old Savannah Grove Elementary School (search) student was in court Monday with two other fifth graders, all charged after school officials found the gun Friday.

The three discussed killing the principal, then running away to Florida, Florence County (search) deputies said.

On Friday, one boy brought the gun and some clothes to school, while the other two boys packed nothing, authorities said.

When the boy showed his friends the gun, they told a teacher, who evacuated the room and took the gun, investigators said.

Deputies found a drawing inside the armed boy's backpack showing two Grim Reapers (search) over a mangled body, and he told them the body was the principal.

A judge ordered him Monday to be kept in a juvenile prison.

The other two students, both 12 years old, were charged with conspiracy and released to their parents where they will remain under house arrest.

None of the boys were named because they are juveniles.