San Jose police say Raul Hernandez, 20, and a 14-year-old teen, were taken into custody on Wednesday.
Police said at least 20 people, including children, were inside Hillview Public Library on Monday when a confrontation outside moved into the busy library.
RELATED: Experts have tips to stay safe with more shootings locally, nationwide in safe spaces
Experts have tips to stay safe with more Bay Area shootings happening in safe spaces
A person was shot and was taken to the hospital with non-life threatening injuries.
That's when shooter and a second suspect got away, police said.
RELATED: Violent weekend in San Jose claims 2 lives, including Safeway employee killed in shooting at store
The shooting victim is expected to survive.
Hernandez was booked into the Santa Clara County Main Jail for attempted murder and various other charges. The teen was booked into juvenile hall for the same charges.