A fight between two California prisoners quickly raged out of control Wednesday and forced correctional officers to open fire to stop a melee that sent eight guards and seven inmates to hospitals, corrections officials said.

Guards in three gun towers fired 19 bullets from semi-automatic rifles and three hard foam rounds to stop large groups of prisoners from attacking guards who were using pepper spray and batons to break up a fistfight at high-security Pelican Bay State Prison near the Oregon border.

Five of the seven injured inmates suffered gunshot wounds. One was airlifted to a different hospital for a higher level of care, said Terry Thornton, a spokeswoman for the California Department of Corrections and Rehabilitation. Three inmates who were shot were admitted to hospitals and two were discharged back to prison, she said.

All of the injured guards were treated and released. One of those officers will eventually need surgery for an injured shoulder, Thornton said.

"They all had like facial injuries, bumps, bruises, contusions," she said. "It's a frightening incident. It's frightening to have inmates just swarm you ... to overwhelm you and attack you."

Several hundred of the prison's roughly 2,000 high-security inmates were in an exercise yard when two inmates began fighting, she said. They would not stop, and other prisoners ran toward the fight.

"They just ran toward the incident from several areas of the yard and just rushed the officers," Thornton said. "They overwhelmed them. Overwhelmed is the word I heard again and again."

Two inmate-made weapons were found. They appeared to be makeshift weapons that inmates grabbed during the fight, Thornton said, and officials did not yet know if they were used on the officers.

"One of them may have suffered a puncture wound, but we don't have confirmation on that yet," she said.

Ninety-seven inmates were isolated in a disciplinary housing unit after the assault.

"As the investigation progresses, we'll have a better idea how many inmates were actually involved. But the fact that the 97 inmates were rehoused indicates they had some level of involvement," Thornton said.

Investigators don't yet know whether it was a planned attack on correctional officers or if it was gang-related, she said.

Counselors were sent to the prison to help employees recover.

"We're encouraged that the officers weren't injured more than they were," Thornton said.