Ms. Weinstein is the general counsel of the Brooklyn district attorney’s office.

On the night that we first came to the United States — Christmas Eve, 1979 — my mother, my brother and I were what President Trump would probably call illegal aliens. Like most of the immigrants at America’s borders today, we were fleeing violence and instability in our native home.

In our case, the home we left behind was Iran, then in the grip of the Islamic Revolution. My parents and grandparents had watched, from the windows of the house we shared, as Tehran University was overrun by protesters. Rumors swirled that anyone who had a connection to Israel — where both my parents had gone to college — could be charged with Zionism, apparently a crime. As Jews, my parents and grandparents became afraid to go to work and even to leave the house. One day our next-door neighbors disappeared.

In February 1979, when the Ayatollah Khomeini returned to Iran from exile, intent on establishing an Islamic theocracy, my parents decided it was too dangerous to stay any longer. By that time, it was not possible to buy a plane ticket out of the country, but El Al, the Israeli national airline, still had some flights going in and out. My parents heard that Jews could board the planes before they flew back to Israel, and they decided that my mother would take my brother and me, 1 and 3 years old, while my father would join us later, after arranging my grandparents’ affairs. Then we would travel to the United States.

My father took us to the airport, kissed us goodbye and promised to see us in a few days. But our flight turned out to be one of the last planes El Al flew out of Tehran. It was months before my father managed to get to Turkey and then reunite with us in Israel.

In Israel, my parents decided that my father should head to America first, to find work and housing. He entered the United States with a tourist visa and got a job in Maryland as a dishwasher. He made his way to New York City and secured work as a hydraulic engineer, his field in Iran, and eventually, an apartment for us in Rego Park, Queens. A few months later, my mother followed — a 26-year-old woman with two children and a suitcase stuffed with pots and pans, a few items of clothing for each season, photo albums and a couple of toys.

The three of us arrived at J.F.K. Airport on Dec. 24, 1979. The tourist visas that we had in our Iranian passports were almost certainly fake; my mother had bought them at an exorbitant price from a travel agency that sold them to us in combination with our one-way tickets. And even if they had been real, we didn’t look like tourists. How many tourists take their rice cooker on vacation?

When it was our turn for inspection, the Immigration and Naturalization Service officer — very reasonably — challenged my mother’s claim that we had come for a short visit. My mother didn’t say that what she really wanted was asylum, that we had a well-founded fear of persecution in our country of origin. My mother didn’t know that those words had the power to keep us in America, that anyone on American soil had a right to be heard on that claim. Maybe because she had grown up in a country with no such protections, she couldn’t imagine such a thing.

We could have been turned away. But that nameless I.N.S. officer — about whom I know nothing other than how he conducted himself in that moment — made a different decision. Before him stood a young mother traveling alone with her babies, visibly in need of refuge. She told him that the children wanted to see their father, that they had spent months apart. And he granted us “deferred inspection” — meaning that we had permission but not authorization to enter the country — and told us to come back to the airport right after the holiday for deportation.

I have thought a lot about that night in the years since. As a child, I attributed my freedom in this country to a small miracle — the accident of having arrived on Dec. 24, a holy day for a vast majority of my new countrymen and women. Maybe that was why the officer exercised the law with mercy and compassion.

But as an adult, and over years as a law enforcement official, I came to understand better the true nature of my life’s course — a life and career made possible because the law was not enforced against me.

For those who support maximalist law enforcement — and “sealed” borders — my presence in the United States might look like a failure. But blind enforcement is not what it means to live in a society of laws. In a democracy, anyone who has the power to enforce the law also has the power — and the duty — to enforce it with discretion. Not every crime should lead to punishment. Not every punishment should be meted out at the maximum. Law enforcement requires us to exercise our humanity and sense of justice, always mindful of the demands of safety, in individual cases. Discretion in law enforcement can be abused, of course, but the alternative — the letter of the law without the spirit of the law — is worse.

I was lucky to stand before a law enforcement officer who understood this, and who granted my family a few days of freedom when we needed them most. Thanks to him, we were reunited with our father in Queens.

From there, my mother was able to call one of the only Americans she knew, a rabbi who told her about the Hebrew Immigrant Aid Society, a nonprofit devoted to helping refugees. The day after Christmas, we walked into the society’s offices in downtown Manhattan and my parents learned how to apply for asylum.

The Hebrew Immigrant Aid Society continued to represent us, pro bono, for nearly a decade while my parents made their asylum case. Life during that time was not always easy. I remember coming home from school one afternoon to find my mother, who had found work as a schoolteacher, crying in the kitchen after a colleague had threatened to have her deported. I remember long days spent at the I.N.S. building in Newark, periodic reminders that even as our life in America took root, our situation was precarious.

Our uncertainty ended in 1986, when President Ronald Reagan signed a law making any immigrant who entered the country before 1982 eligible for amnesty. There has not been an amnesty program in this country since.

President Trump has radically changed both the letter and the spirit of the laws that govern immigration and asylum. His administration has issued more than 60 serious changes to the policies and rules that determine who may come to the United States and how. Taken together, these changes have curtailed the possibilities for countless children with cases like mine.

When I arrived in the United States, I was not separated from my parents. My parents were not arrested for an illegal border crossing. They were not turned away before they could explain why we sought asylum. We were not detained in cells. We did not have to rush through an expedited proceeding, forced to prepare our case in a matter of days or weeks. Instead, we were able to plead for refuge while living here in safety, with access to lawyers who helped us navigate the complexities of immigration law.

As a child, I was shown that the law could be enforced with goodness and humanity. For my family’s first Christmas, America gave us safety, kept us together and offered us a chance at a new life. I wish the parents and children at our borders could expect the same gifts today.

Tali Farhadian Weinstein is the general counsel of the Brooklyn district attorney’s office. She teaches criminal justice reform at New York University School of Law.