My office here overlooks a well-tended rose garden, surrounded by high concrete walls and scrolls of razor wire, which the neighborhood cats have learned to navigate unscathed. Beyond, though, danger lurks: car bombs, kidnappings, shootouts between insurgents and police.

Every time I venture into the streets, I pass spots where friends have been killed and convoys of American soldiers ambushed. When a few suspiciously quiet days pass, I start wondering how soon the next bomb will explode, whether any American troops will be killed or whether the number of Afghan casualties will be high enough to merit mention in my newspaper.

In repeated stints as a correspondent here, I have seen public hopes rise and fall, peace dangled and snatched away again. I have miraculously escaped injury, except for smashing a tooth on a helicopter bulkhead. But I have run out of new ways to describe the sorrow and horror I have witnessed again and again.

As I prepare to leave Afghanistan and full-time newspaper reporting after most of three decades spent as a foreign correspondent, I’ve been looking forward to putting hardship and conflict behind me: to taking up a saner life of reflective writing, traveling, caring for needy animals and sipping mimosas at my village pub in Virginia. Instead, I find myself bracing for what awaits me back home, where an angry political and cultural gulf has opened up — strife that I won’t be able to escape by waving my passport at an airport immigration officer.

Overseas, I’ve always been an observer of someone else’s struggles. I have politely absorbed anti-American diatribes, insisted on my standing as a neutral party and kept taking notes. If asked about my religious or political beliefs, I have demurred or downplayed them. I have taken many physical risks, but I never took a side or had to summon the real moral courage that comes with it.

Now, from a distance, I have watched my prosperous, law-abiding society turn into a battleground, with mass shootings in schools and malls and places of worship, diatribes drowning out debate, online anonymity unleashing vengeful fantasies, institutional safeguards being jettisoned, the press pilloried as a public enemy, and people hesitant to speak to strangers in checkout lines.

After so many years of carefully separating my personal and professional selves, I know that when I return to the United States, I’ll feel more exposed — and more compelled to take a stand for my convictions. No flak jacket and headscarf will wait by the door to keep me physically and emotionally armored.

Just over a year ago, something terrible happened at the first newspaper where I worked after college, covering boat shows and city council meetings and hanging out at waterfront bars. An angry man with a shotgun opened fire on the offices of the Capital Gazette in Annapolis, killing five staff members.

I read about the tragedy online, sitting in my bunkered office 7,000 miles away. I thought back to that cramped and collegial newsroom 45 years ago, full of eager young reporters like me. Then I looked out at my perimeter of concrete and razor wire and thought: I don’t know my own country anymore.

I first came to Kabul during Taliban rule, a time of fearsomely imposed order that followed a nasty civil war. The religious vigilantes put a swift end to crime and chaos, but they lashed men for being late to prayer and women for letting their ankles show. As a Western guest, I was treated with respect but required to cover everything except my face. At night, turbaned gunmen stood guard outside my hotel room door.

When Afghan and American forces overthrew the Taliban in 2001, Afghanistan became an instant laboratory for democracy-building. Money flowed in and do-gooders came from across the world to help modernize ministries and draft a new constitution. International largesse built schools, repaired roads and installed irrigation systems. During the first presidential election in 2004, I was moved to tears as I watched villagers line up in a school to mark ballots printed with emblems of lamps, lions or trees, because so few could read. Over the next decade, a new generation of Afghan men and women studied English, became computer-literate and began running for public office.

But the past kept pushing back. Ethnic warlords clashed over political spoils, opium poppy production resurged, and subsequent elections were marred by fraud and threats. The Taliban reemerged as a nimble insurgency, while Afghan forces backed by the United States and NATO struggled to compete.

Even with America aiding and defending them, many Afghans resented the United States. Some were susceptible to Taliban propaganda that equated Western democracy with immorality and drink. Some turned on their U.S. mentors or superiors; in 2014, a visiting American general was shot dead by a young Afghan soldier in uniform.

The country’s first post-Taliban president, Hamid Karzai, often railed about American “occupiers” bombing Afghan villages. Its current president, Ashraf Ghani, took office as a U.S. ally, but he and many Afghans worried that U.S. peace talks with the Taliban were a pretext for American forces to abandon them.

I understood these concerns and privately shared some of them. In other parts of the world, from Chile to the Philippines, I had witnessed the tragic consequences of U.S. alliances with tyrants. Yet I bristled when people denounced the United States as an arrogant hegemon, and I clung to the belief that it could still be a role model for the world, built on values and laws that could withstand turmoil at home.

In Afghanistan, I got to know engineers from Texas, veterinarians from Maine and lawyers from Harvard who had signed up to help build a modern democratic state. I met professors who came to teach at the American university in Kabul, even after the Taliban kidnapped two of their colleagues. I did not always agree with American policy, but I still believed in the American spirit.

Today, I am one of the few American civilians left in the country, and most others are confined to guarded compounds. I watch the news from home through an Afghan prism: TV broadcasts start with the latest Taliban attack, then switch to the latest American mass shootings or angry presidential tweets.

Recently, I approached some shoppers to talk about the peace negotiations. One man asked me sharply where I was from. Almost without thinking, I replied, “Canada.” It was a way to avoid argument — and a confession to myself. For the first time since Taliban rule, I felt uncomfortable revealing my nationality.

Experts on Afghanistan tend to blame its ills on tribalism, warlords and religious absolutism. They advise stronger institutions over personal rule and rational debate over Kalashnikov culture. But as I follow the breakdown of American public life today, I see signs that, for all our supposed sophistication, we are not immune to the same visceral forces.

I see it in the spread of anti-vaccine sentiment, which I first encountered while reporting on efforts to eradicate polio in poor areas of Pakistan and Afghanistan. I see it in the growing legal crackdown on abortion, after years of covering the extreme restrictions Afghan village culture imposes on women’s personal rights.

In Afghanistan, four decades of war have left the country awash in weapons and violence, and the U.S. Embassy regularly warns foreign visitors to watch out for terrorist kidnappings and armed robberies.

In the United States, with historic traditions of compromise and conflict resolution, lethal violence and military-style weapons are also spreading. Recently, governments from Japan to Uruguay have warned their citizens to take precautions if they travel to America. One of them bluntly described it as a “gun society.”

I still cherish America, the home of Lincoln and Steinbeck, Copland and King, a nation whose charter enshrines the rights to question authority and pursue happiness. I am still prepared to defend its ideals and institutions. But I am unsure I will know how to navigate what it has become in my absence — how to find the right balance between caution and connection.

In Afghanistan, I know who the enemy is and how to protect myself, ducking inside shops and keeping away from military convoys. When I return to America, though, I fear I will be entering a strange landscape without a compass. I listen to today’s political rhetoric, thick with contempt and belligerence, and it sounds like an alien language.

A few months ago, on a visit home, I pulled up to a bank and mistakenly parked a few inches into the next space. When I came out, there was an unsigned note on my windshield, denouncing me in vicious, vulgar language. A few days later, a speeding car careened toward me on a highway, smashing into my left front door before the driver backed up and raced off. For the next half-hour, I sat there, uninjured but shaken, waiting for the police.

Hundreds of drivers passed by, but no one stopped. In Afghanistan, it would have been prudent to keep going for fear of an ambush. In America, I thought someone would at least slow down to see if I was all right. But gradually, it occurred to me that people might be afraid to stop. Maybe they thought I could be armed. Maybe their hearts had simply hardened during my years away. I had no way to know any of this, but I had never felt so alone.