“Are you in the newsroom? I’m hearing there was a shooting. I can’t get ahold of anyone.” I heard the catch in his voice the same moment I saw dozens of police cars tearing toward Annapolis in the breakdown lane.

The call was from my editor Rick Hutzell on June 28, 2018, the day a man fired a shotgun through the glass doors of the Capital Gazette newsroom. He killed five of my colleagues and friends: Rebecca Smith, Wendi Winters, Gerald Fischman, Rob Hiaasen, and John McNamara. Two more were injured.

That morning, I had driven to the United States Naval Academy to photograph the induction of the newest class. I had been a staff photojournalist for the Capital since 2004. That day, after I filed my photos, I snuck out early to take my daughter out for birthday snowballs. That’s when I got the call.

I knew what to do, which was what I’d done my whole career. I turned my car around and headed to the Capital office to cover it.

Now, after very nearly 20 years of covering my neighbors and community, including reporting through a mass shooting at my own newspaper, I am taking a buyout and leaving the Capital Gazette. It’s an encapsulation of both the challenges journalists today face, and why I have hope for the future.

The day of the shooting, I arrived at the office and police were everywhere. I took out my camera and captured the wide scene, took some detailed shots, took a minute or two of video, all while tweeting out the images. Don’t think, I repeated to myself. Don’t worry. Just do the job.

Two of my colleagues, fellow journalists — Pat Furgurson and Chase Cook — arrived. We gathered facts, confirmed who was alive, and then who was dead. We transmitted from the back of Pat’s pickup in the mall garage across from the newsroom. We all struggled to keep our emotions at bay.

The next day, we put out a paper that covered the shooting, with help from staff at the Baltimore Sun. The suspect, now the admitted murderer, was a man we’d written about years before who pleaded guilty to harassing a woman on Facebook. He was angry, tried suing the paper, and lost in court there, too. He then went silent for years. We’d long forgotten him, until that horrific day.

In a moment, the staff of the paper had transformed from colleagues to family. There was no need to say it to each other. A force had tried to silence us and silence journalism at large, but we would not let it.

The next year brought first the funerals, PTSD for many of us, a Time magazine cover, and a Pulitzer Special Citation. It brought us a blur of feelings and trauma and laughter and family and frustration, and every day we produced a new issue of the Capital. We never missed a single day.

This March would have been 20 years for me with Tribune, the company that owns the Capital Gazette. Last week saw company-wide buyouts of veteran staff members across the Tribune’s papers. When I joined the staff, there were five photojournalists and a photo editor. Two weeks ago we were down to just two, myself and Paul W. Gillespie, who survived the shooting. Now it’s just Paul.

Last week, I took the buyout. The decision was almost as hard as what I went through two years ago.

I first fell in love with the newsroom at my first journalism job at a scrappy, old-fashioned biweekly called the Aegis, later bought by Tribune, in Harford County, Maryland, in 2000. We were all mostly kids, led by gruff professionals who had seen it all and were patiently beating the heart and soul of journalism into our heads. Seeing our work come to life — seeing our work validate the truth and lives of our readers — was as fulfilling as almost anything I know. It became my life and how I defined myself.

Every day, we put into practice this belief: Journalism matters. We locked the facts down, gave voice to our community, and made a difference. Corrupt public officials resigned because we reported on them. Traffic lights went up at deadly intersections because we reported on it. High school kids were spotlighted, and in turn they were told that the world saw them. A community comes together naturally, but I believe that a community needs to be shown it is real, that it matters. That’s the last real mission of American journalism.

You know the next part. Our papers, just like local journalism everywhere, were hit by consolidation and cuts. Between 2004 and 2018, newsroom employment has fallen by 47 percent. Just last week, McClatchy, which owns 30 local newspapers around the country including the Miami Herald and the Kansas City Star, filed for bankruptcy. As it felt like the industry around me was crumbling, I looked to my newsroom mentors and how they tacked into the wind and kept working. I did the same. What currents were eroding the industry was last on the list of what was most important to me. What was important was continuing to put out a paper.

Why did I take the buyout now? Twenty years is a lot, and there have been hard times in my career as a photojournalist. But there are no words to describe the last two years. You give and you give, and the traumas add up, and eventually, I wondered if I owed this business any more of myself. For the moment — clearly briefer than I imagined because here I am staring at a deadline again for this piece — I could say I’ve given enough. That’s one reason.

But there’s another reason, and that reason is what gives me strength. My last assignments for the Capital were with two young journalists, Naomi Harris and Olivia Sanchez, excellent reporters who are working on some amazing projects. They are bright and sharp and see the world clearly. They see the hurricane of attacks buffeting journalism on all sides, and they stepped up. They didn’t grow up in a world of endless advertising profits paying decent salaries. They are volunteering not despite the challenges, but because of them. They see the job needs doing and are going to do it no matter who tries to stop them.

Despite everything, I’m more optimistic than ever. This is the golden age of local journalism, of American journalism. What we do matters. And what we do will continue. Count on it.

Correction: A previous version of this essay misspelled Pat Furgurson’s and Rob Hiaasen’s names.

Joshua McKerrow is a veteran photojournalist based in Annapolis. With the staff of the Capital, he was part of a Pulitzer Prize Special Citation and a Time magazine Person of the Year.