NEW YORK (AP) — A crying Honduran girl depicted in a widely-seen photograph that became a symbol for many of President Donald Trump’s immigration policies was not actually separated from her mother, U.S. government officials said on Friday.

Time magazine used an image of the girl, by Getty Images photographer John Moore, on its cover this week, next to a picture of a towering Trump. While Time corrected a story it had written about the photo, its top editor defended the cover.

White House press secretary Sarah Sanders said it was “shameful” that Democrats and the media exploited the photograph to push an agenda.

“She was not separated from her mom,” Sanders tweeted. “The separation here is from the facts.”

The photo spread widely as the discussion heated up of Trump’s since-reversed policy of separating parents who are caught illegally crossing into the United States from their children. The government’s policy of not allowing photographs of children being detained heightened the impact of pictures about the immigration issue.

READ MORE: What’s in Trump’s executive order on family separation?

The girl’s picture, along with an audio file of crying children that was given to reporters at ProPublica, helped galvanize public opinion against the administration’s policy.

The photo was taken on June 12 by Moore, who was on patrol with U.S. border officials when they encountered the girl’s mother, identified as Sandra Sanchez. The girl was crying as officials searched Sanchez, who U.S. Immigration and Customs Enforcement said on Friday had been previously deported from the United States once before.

“At no point did I ever say that the girl and her mother had definitely been separated,” Moore said, “but at the time I took the photo that was a very real possibility even for young children. I think I’ve been very clear from the start that the mother and daughter were taken away in the van together but that we didn’t know what would happen to them.”

Moore said it wasn’t until he found out from ICE that he knew they weren’t separated. ICE said Sanchez is being housed at one of the government’s three existing family detention facilities at the South Texas Family Residential Center in Dilley, Texas, 230 miles north of McAllen, Texas. The agency would not provide information about the girl, citing privacy concerns.

Time magazine said in a correction to a story written earlier this week about the photograph that “the girl was not carried away screaming by U.S. border patrol agents. Her mother picked her up and the two were taken away together.”

The girl’s picture helped galvanize public opinion against the administration’s policy.

It was not immediately clear how the error occurred.

Time decided to use the photo for its memorable cover, showing Trump and the girl before a red background and the caption, “Welcome to America,” even after it learned about its mistake.

The photo “became the most visible symbol of the ongoing immigration debate in America for a reason,” said Edward Felsenthal, Time editor-in-chief. “Under the policy enforced by the administration, prior to its reversal this week, those who crossed the border illegally were criminally prosecuted, which in turn resulted in the separation of children and parents. Our cover and our reporting capture the stakes of this moment.”

The border patrol agent who picked up Sanchez, Carlos Ruiz, told CBS News that “they’re using it to symbolize a policy and that was not the case with this picture.”

In Honduras, the girl’s father, Denis Varela, said he hadn’t heard from his wife or daughter in almost three weeks, and that Sanchez took their daughter to the United States without telling him.

He said the Honduran foreign ministry also told him that his daughter is detained with her mother and the two have not been separated.

Varela, a dockworker who lives in Puerto Cortes, Honduras, said that the ministry gave him the girl’s detainee identification number a couple of days ago.

Moore said that he was happy to hear that although Sanchez and her daughter are being detained, they are still together.

“The photograph I took is a straightforward and honest image,” he said. “It shows a brief moment in time of a distressed little girl, whose mother is being searched as they are both taken into custody. I believe this image has raised awareness of the zero tolerance policy of the current administration. Having covered immigration for Getty Images for 10 years, this photograph for me is part of a much larger story.”

Associated Press correspondents Colleen Long and Mark Stevenson contributed to this story.