In this file photo, law enforcement personnel from various agencies run with guns drawn toward an ongoing officer-involved shootout in San Bernardino after a terrorist attack earlier in the day at the Inland Regional Center in San Bernardino on Wednesday, Dec. 2, 2015.

In this file photo, law enforcement personnel from various agencies run with guns drawn toward an ongoing officer-involved shootout in San Bernardino after a terrorist attack earlier in the day at the Inland Regional Center in San Bernardino on Wednesday, Dec. 2, 2015.

I expected Dec. 2, 2015, to be anything but exciting. I had set aside the day to comb through Beaumont city records, looking for invoices from companies owned by former city officials targeted in a corruption probe.

It had been 24 years since I worked full time as a crime reporter. These days I write about environmental issues and I investigate corruption in local government.

But late that morning, a news alert flashed across my computer screen. More than 20 people had been shot in San Bernardino. After a quick call to my editor, I headed north from Riverside to San Bernardino toward the site of the shooting, a complex of offices and meeting rooms called the Inland Regional Center.

I ended up behind police lines, more than half a mile from the attack site.

I interviewed people gathered at a small shopping center, hoping to learn the fate of their loved ones. Rumors abounded. One lady said the San Bernardino County courthouse may have been attacked, so I drove there.

Sheriff’s deputies with assault rifles guarded the building, but there was no attack.

I listened on my car radio while San Bernardino Police Chief Jarrod Burguan addressed the nation. His words seared my consciousness: Fourteen dead. Two suspects at large. Last seen in a black SUV.

The chief also said that those who worked at the regional center and were not hurt were going to be bused to a community center near the downtown area. I went there and found family members gathering, as well as dozens of reporters and photographers seeking interviews.

A woman told me something I did not expect. A friend had texted her that his office building was locked down because a black SUV was spotted in the area.

So I drove toward the southeast part of the city, feeling good about being away from the media hoard, checking out a tip no other reporter had. As I approached Tippecanoe Avenue, I saw two speeding Redlands police cruisers, red lights flashing, turning east onto San Bernardino Avenue.

As I followed, I heard thundering sounds as well as something making a whipping noise in the air just outside my open driver’s side window. Could that be gunfire?

I wasn’t sure, but something wasn’t right. I saw two or three police cars stopped about a block ahead of me. I pulled over by a warehouse, parked, grabbed my camera and cell phone and walked toward the police vehicles.

As I approached, I called my editor, John Bender, and told him I was going to check out the police action on the avenue just east of Richardson Street. He asked me to report back when I learned what was going on. I was nervous but I didn’t think I was in danger. I’ve been a reporter for 32 years and had approached crime scenes many times before.

At the worst, police would tell me to leave, I thought.

While I spoke with Bender, I suddenly heard the rapid pop, pop, pop of gunfire. There was no ambiguity this time. I could hear and practically feel bullets flying past my body. Imagine a sound that’s a cross between swish and thump. It’s like no other.

I never felt more vulnerable. The wide boulevard was to my left and a vacant lot was to my right. I had no place to take cover.

Fortunately, two or three police cars screeched to a stop about 30 yards ahead of me. I ran toward them, which also happened to be toward the gunfire. Their vehicles offered the only possible protection from the flying bullets.

While I crouched behind a patrol car, I saw more officers arriving and stopping in the middle of the street. Several ran past with handguns and rifles before they took cover just yards ahead of me.

I remember one female officer motioning for me to keep my head down as gunfire continued in intermittent volleys.

I began taking pictures of the police battle. I couldn’t see the terror suspects who were firing back, or their vehicle. The camera was a refuge from fear. Taking pictures got my mind off the danger.

But this was no place to be. During a silent moment, I scampered across the street, taking cover behind police cars as I ran.

I spotted a wrought-iron fence held up by a cinder-block base near the front yard of a house. I dove into a garden behind the fence, hugging the ground as I hid behind the cinder blocks, which were only a foot and a half high.

The gunfire stopped, but the silence was disconcerting. I stayed as low as possible for what was probably several minutes. It seemed like an eternity.

I peeked around the wall to see two officers, one with federal Department of Homeland Security insignia. He pointed a handgun at me at point-blank range. I stood up slowly, holding my hands out, my camera dangling from the strap around my neck.

“I am a reporter,” I said. “I just got caught up in this.”

He pointed the gun away from me, explaining that my black camera could be mistaken for a gun. I felt an unbelievable sense of relief. I had survived!

I went to a nearby home where a friendly woman gave me a cold bottle of water. I sat down in the backyard and called Bender, giving him my firsthand account of the shootout. He grilled me for details, wrote it up and posted it on the newspaper’s website.

I went to the front porch where police were telling people to stay indoors because they were searching for pipe bombs that may have been thrown from the suspects’ SUV.

One of the officers escorted me out, and I joined a gaggle of journalists arriving on the other side of the yellow tape.

Word quickly got out that the two terror suspects had died in the shootout, and, thanks to Bender’s post, that a local reporter had witnessed it.

My cell phone exploded with calls from the media wanting to interview me. My wife, Lorrie, learned what I went through from a Fox News producer who called our house to book me for Megyn Kelly’s show later that night. CNN’s Anderson Cooper interviewed me as I drove back on the 215 Freeway to the newsroom in Riverside where I picked up calls from MSNBC’s Rachel Maddow and a reporter from the BBC, among others.

In the aftermath, details emerged that put my experience in context.

About 400 shots had been fired during the shootout between police and the two terrorism suspects. And their bullet-strewn SUV had stopped about 50 yards from where I took cover behind some cinder blocks. I also learned that after police killed the husband-and-wife terror team in the shootout, they began looking for a third suspect.

Apparently, someone was seen taking cover behind a wall not far from the black SUV.

David Danelski is an investigative and environmental reporter for The Press-Enterprise newspaper in Riverside, California. He has been with the newspaper since 1990 and has previously covered crime, transportation and city government. He is married to Lorrie Cobain, a teacher and staff development specialist for the Riverside Unified School District. The couple has one adult daughter, Rosemary. who lives in New York City.