Though we had our differences, Jamal Khashoggi and I were kindred spirits. We both wrote for The Post’s Global Opinions section, we both believed in the ideals of democracy and free speech, and we were both targeted by authoritarian regimes for our journalism.

In 2014, while I was serving as The Post’s Tehran bureau chief, my wife and I were abducted from our home in Tehran by Iranian authorities and taken to Evin prison. I was held as a hostage by the regime for nearly a year and a half. It was an uncomfortably intimate encounter with authoritarian thugs that left me deeply scarred.

I was eventually released in 2016, after spending 544 days in prison. By the fall of 2018, I felt as though I had nearly put my life back together — but I hadn’t entirely settled. In my first months back at The Post, because of the high-profile nature of my detention, I felt like little more than an unwilling poster child for the perils of being a contemporary journalist. To rebuild my confidence and do work that felt important, I dedicated much of my writing to telling the stories of other reporters who found themselves the targets of unreasonable governments that couldn’t abide free expression.

I wrote stories about journalists threatened, harassed, detained and in some cases murdered for the work that they do. I never imagined that I would be writing columns about a fellow Post contributor whom I was just getting to know.

I was attending a lunch at the National Press Club on Oct. 2, 2018, when I learned that Jamal had gone missing. I received a text message from a mutual friend, someone who had hosted Jamal and me at her home for an unconventional Ramadan iftar several months earlier.

“Apparently, his son has had no word. In the dark. Very odd that Jamal has not tweeted in 20 hrs,” she wrote.

As the hours dragged on, I quietly feared the worst while still hoping for the best. But when Saudi authorities claimed Jamal had left the consulate, although the facility’s own closed-circuit-camera footage showed no signs of him exiting the building, my hopes began to dim.

That afternoon, my editors asked me to write our first piece about Jamal’s disappearance, an assignment I accepted without hesitation, but one I immediately wished I had never been given. As grim news continued to stream in and we began to mourn for our lost colleague, it was easy to feel entirely hopeless.

Amid those awful circumstances, though, I realized that telling the story — our story, and the stories of other journalists targeted for their words — was the perhaps the only real way to fight back. After being the subject of thousands of articles and news reports during my time in prison, I was now one of dozens of journalists desperately trying to uncover anything we could about Jamal’s fate. I watched my Post colleagues in all departments of our organization, led by publisher Fred Ryan, fully commit to getting to the bottom of what happened. For me, the process offered a glimpse of precisely what The Post’s newsroom had been doing in the days and weeks that followed news of my detention. This time, though, I was able to participate in the mobilization — and witness the results.

Every new headline piecing together the highly coordinated Saudi effort to silence Jamal, and laying out what could be done in response, showed me firsthand the power that journalism has to drive conversations and expose injustice. Every time the world saw and heard Jamal Khashoggi’s name in a new article or segment, we tore deeper into the facade of an evil dictator’s bogus promises of change.

It is hard to escape the sense that all journalists are under attack by forces who want to take the world backward. Jamal and I knew it. We had both experienced it firsthand. Some may draw from his murder the conclusion that individual voices stand no chance in the face of great powers — especially now that disinformation and other forms of state deception have become so prevalent. But I prefer an alternate view, a more hopeful one that I think Jamal would share if he were commenting on this.

Authoritarians are having a moment, no doubt, but they are clearly nervous. Today, more people than ever feel empowered to speak out — not only in spite of repressive leaders, but because of them. And people are willing to fight for justice — for me, Jamal and any other journalist whose work is deemed intolerable by repressive regimes.

Even in very dark times — as Jamal knew well — that’s more than enough reason to sustain hope and keep pressing ahead.

Read more about Jamal Khashoggi:

A missing voice, a growing chorus

Tamara Cofman Wittes: Arab political exiles face a bleak reality. Could there be hope?

Mohamed Soltan: How Jamal Khashoggi gave Arab dissidents mentorship — and a community

Ezzedine Fishere: Jamal Khashoggi symbolized the promise of reconciling political Islam and democracy

Tawakkol Karman: We need justice for Yemen — and justice for Khashoggi

David Von Drehle: Hollywood loves triumphant journalism stories. This isn’t one of them.