By now, millions of people have seen a photo of a 2-year-old girl screaming while a U.S. border agent pats down her mother. Taken last Tuesday, the image has become a symbol of the Trump administration’s new “zero tolerance” border policies, which have caused hundreds of children to be removed from the parents who brought them here.

What you didn’t see was John Moore, crouched six feet away, who had to literally catch his breath after taking the picture because it pulled something out of him.

An award-winning photographer for Getty Images, Moore has documented wars, diseases and refugee crises around the world. This is the story of how he found a little girl and her mother beside the Rio Grande last week and took what could be one of the most high-impact photos of his career.

Photos | This photographer spent a decade at the Mexico border. Here is what he saw.

In some ways, the past 10 years had prepared Moore for the shot, but in most ways, nothing could.

He had been photographing the American migrant crisis for Getty Images since the end of the George W. Bush administration, ever since he returned from covering war zones overseas. He had ridden with destitute families through Central America on the roofs of anarchic freight trains and followed U.S. border patrols as they chased men through Texas scrubland.

He had studied the crisis from so many angles. He knew the secret routes through the deserts, the safest crossings on the Rio Grande and the finer points of the U.S. Border Patrol’s search-and-detention protocols.

He knew that when loners crossed the river by day, they tended to run or hide from Border Patrol. But the large groups that crossed at night often surrendered themselves to the first U.S. agents they found.

The night-crossers were often families, exhausted and terrified from their journeys, seeking asylum from whatever terror had driven them from home.

It was night now. Moore and a unit of Border Patrol guards crouched among the trees on the Rio Grande’s northern bank, listening to the rafts below. He could hear at least four of them sloshing across the river, and just barely make out a dozen or so figures on the two nearest boats.

“It was very hard to see them,” he remembered. “It was a moonless night, almost impossible to photograph.”

But he needed photographs. He’d been waiting all of Tuesday afternoon and evening for them, because he knew what waited for these families on his side of the river.

While they had been evacuating their homes and traveling — some for weeks — the United States had changed the rules. Pleas for asylum that had been accepted for years might now be rejected. Mothers and fathers, who would have been released to await court hearings, would now be jailed. Their children would be seized and held from them by a foreign government.

The American public had only just learned this. Moore and the Border Patrol agents who hid with him on the banks of the Rio Grande knew it. But the people on the rafts . . . “These people had no way to know that,” Moore said.

He listened as they stepped off the boats and crunched over fallen branches, toward a dirt road that led to the town of McAllen at the southern tip of Texas. He heard a child cry in the woods, and knew what the boy had likely faced, and still must face, and it broke his heart a little.

And suddenly the border agents were on the move, and Moore with them, piling into trucks, engines roaring and spotlights glaring.

There was no more hiding now. It was time to meet the people.

There were dozens of them, though it was hard to count in the dark. When the guards’ lights hit them, Moore saw that they were almost entirely women and children. It was about as pure a family exodus as he had seen…