A 16-year-old boy was shot twice and critically wounded by another teenager Tuesday afternoon when the two got into argument outside a middle school in a Salt Lake City suburb, authorities said.

Police arrested a 14-year-old who they believe was the shooter, said Sandy police Sgt. Dean Carriger.

The victim was taken by ambulance to a hospital and is in critical condition, Carriger said. He was in surgery Tuesday evening.

Nobody else was hurt, but dozens of students from Union Middle School in Sandy witnessed the shooting that occurred just as students were leaving school for the day at about 3 p.m., he said.

Detectives were interviewing those students to determine what led to the argument and why the suspect shot the other.

The school, about 15 miles south of Salt Lake City, was briefly put on lockdown.

The suspected shooter is a student at the middle school. The victim is not, Carriger said.

Detectives are trying to find out if the suspect had the gun during school or if he got it after school.