When Jonathan Morales and Oscar Stewart heard the gunshots, they ran toward them.

The off-duty Border Patrol agent and an Iraq War Army veteran helped stop a suspected gunman who had opened fire at Chabad of Poway on Saturday in what authorities praised as an "act of courage."

One person died and three more were injured in the hate-fueled attack during Passover services.

Stewart, 51, was in the back of the room when the shots rang out, he told reporters. The veteran said his military training kicked in.

"I ran to fire. That's what I did. I didn't plan it. I didn't think about it. It's just what I did," he said.

What we know now:Funeral service for San Diego synagogue victim who shielded rabbi to be held Monday, and more updates

Stewart said he started yelling expletives at the gunmen, who stopped shooting when he heard Stewart's voice.

“Get down!” and “I’m going to kill you,” Stewart said he yelled.

According to the San Diego County Sheriff's Department, the suspected gunman fled the synagogue to a nearby vehicle. Stewart was in close pursuit.

"Stewart caught up to the vehicle as the suspect was about to drive away," the department said in a statement.

Stewart said he began punching the shooter's window when Morales told him to get out of the way.

"He yelled, 'Clear back, I have a gun,'" Stewart said. Then, Morales began firing.

More:Funeral for 'hero' synagogue shooting victim today; emotional rabbi lauds congregation's bravery

The off-duty agent hit the car, but the gunman drove away, police said. Authorities later arrested John T. Earnest, 19, along Interstate 15. A rifle was found in the front passenger seat, police said.

"Mr. Stewart risked his life to stop the shooter and saved lives in the process," the sheriff's department said in a statement.

Stewart's heroics didn't stop there. The man said he rushed back into the synagogue where he saw Rabbi Yisroel Goldstein bleeding from his hand and congregant Lori Gilbert-Kaye on the ground.

"I immediately went to the lady on the floor and started doing CPR on her. She didn’t make it," Stewart said.

When houses of worship become targets:San Diego synagogue latest in a deadly trend

According to the San Diego Union-Tribune, Stewart said he served in Iraq from March 2003 to April 2004. He had also been a bomb disposal tech in the Navy, and joined the Army after the September 11 terrorist attacks.

"I never thought I’d hear gunfire again," he told the Union-Tribune.

Goldstein said Morales recently discovered his Jewish roots and traveled more than three hours from El Centro to pray with the congregation. The rabbi recalled telling Morales, “Please arm yourself when you are here. We never know when we’ll need it.”

"I don't think I'm a hero," Stewart said. "I just did what I did,"

Contributing: Trevor Hughes, Chris Woodyard, Doyle Rice and Joel Shannon.