A suspect believed to be connected to a shooting that took place Friday near a high school in Portland, Oregon, was brought into custody early Saturday.

The 22-year-old man, who has not been identified, allegedly opened fire Friday afternoon on four people near Rosemary Anderson High School campus in North Portland, before fleeing on foot with two other men, said witnesses.

Officers from the Portland Police Gang Enforcement Team pulled over a vehicle and arrested the suspect, in addition to recovering a handgun from inside the vehicle.

Portland police Sgt. Pete Simpson said the victims ran inside of a school building after being shot outside on Killingsworth Court, reported CNN affiliate KOIN. They have been identified as 16-year-old Taylor Zimmers, who is reportedly in critical condition and 20-year-old David Jackson-Liday and 17-year-old Labraye Franklin, who are both in fair condition. The last victim, a 17-year-old girl, was treated on the scene for a grazed wound.

"All four gunshot victims are affiliated with the school," police said, reports CNN.

The shooter was never inside Rosemary Anderson High School, said PPB Sgt. Pete Simpson during a press conference. By 1:15 p.m., students were released from the school, which is located at 717 North Killingsworth Court.

Police believe gang activity may have been a factor. Afterwards, the PPB Gang Task Force, the Portland bureau of the FBI and the ATF arrived at the school around 1:30 p.m.

Other schools in the area, Jefferson High School and Portland Community College, were put on lockdown.

The Rosemary Anderson High School website states that the institution is an alternative school that serves at-risk students who were expelled or dropped out, are homeless or single parents. The website also describes the school as "Portland OIC's community-based alternative high school, in operation since 1983, and accredited by the NW Accreditation Commission."