Police said the man confronted and stabbed one of the officers, who then fired his gun. As the officer was struggling with the suspect, the servicemen stepped in and took the suspect into custody.
Both the officer and the suspect were injured, but they are expected to survive.
The suspect was identified only as a 19-year-old Long Beach resident.