Mainstream news organizations are reluctant to show images of the dead. Whether it’s the victims of accidents, mass shootings, natural disasters, terrorism or military conflict, photos and videos of lifeless bodies rarely are published. Rarer still are those involving children.

On Tuesday, there was a striking exception.

Media outlets around the world published a now-iconic photo of the bodies of Óscar Alberto Martínez Ramírez and his 23-month-old daughter, Valeria, washed up in the shallows of the Rio Grande near Matamoros, Mexico. The Salvadoran man and his daughter drowned Sunday in an attempt to migrate to the United States.

The searing image seemed to capture the heartbreak, desperation and danger of immigrants fleeing their countries. In the photo, Valeria’s tiny arm is flung across her father’s neck in a haunting embrace, her body tucked inside his T-shirt. Both are face down in the muddy, brown river water.

The photo was taken by Julia Le Duc, a journalist with the Mexican newspaper La Jornada, which published it Monday morning. It gained international attention on Tuesday after it was distributed by the Associated Press, which provides news and photos to thousands of newspapers, broadcast stations and online publications.

The image quickly began appearing — to a shocked reaction — online and on some TV networks and stations. On CNN on Wednesday, anchor Brianna Keilar broke briefly into tears as she narrated the story behind the photo.

Many compared it to the 2015 news photo of Alan Kurdi, a ­3-year-old Syrian boy whose body washed up on a beach in Turkey after he and his family attempted to migrate to Europe, or the photo of a dazed and bleeding Syrian child, Omran Daqneesh, who was pulled from the rubble in Aleppo in 2016 after an airstrike by the Syrian regime. Both captured the world’s attention, with the former sparking talks that led to more funds for the resettlement of Syrian refugees.

The decision to distribute the photo of the father and daughter came after discussions among AP editors in New York and Mexico City, said John Daniszewski, the news service’s vice president for standards. “Normally, we don’t show scenes of death,” he said in an interview. “But in this case, we felt it was a respectful and poignant photo that conveyed an important moment and a lot of factual information about what’s going on along the border.”

Given the graphic nature of the photo, AP’s editors decided to package it with a staff-written news story explaining who the victims were and how they died, including an eyewitness account by Ramírez’s wife, who spoke to Mexican police. They also moved a related blog post by Daniszewski that carried the headline, “Why we published a border deaths photo.”

“The AP does not transmit highly graphic or disturbing photographs for their own sake,” he wrote. “We also avoid images that are gratuitously violent. But we have through our history made the decision at times to show disturbing images that are important and that can convey the human cost of war, civil unrest or other tragic events in a way that words alone cannot.”

Other news outlets issued warnings, such as the one on MSNBC.com: “The photo you are about to see is very graphic and some might find it disturbing. In a stark reminder of the perils at the border, the Associated Press today published images of a man and his 23 month old daughter from El Salvador who drowned in the Rio Grande river on Sunday.”

While the photo gained wide and nearly instant circulation via digital sources, most U.S. daily newspapers did not publish it on their front pages, including The Washington Post.

A major exception was the New York Times, which featured it as the “display” photo, the leading image on its front page. The photo ran across four columns with a two-line caption that included a referral to a news story inside the paper.

Like the AP, the Times’s editors spent some time Tuesday afternoon discussing the pros and cons of publishing the photo, said Beth Flynn, the newspaper’s deputy photo editor. With deadline approaching, one editor called editors at the AP to get more information about the photo and the photographer. A group of top editors, including Executive Editor Dean Baquet, then discussed what to do.

“Most of us, the majority, felt very strongly that we should run it” on the front page, Flynn said. The accompanying news story “tried to tell about who these people were so that they weren’t just anonymous people coming to our country,” she said.

Few readers criticized the Times’s decision, judging from comments posted online. One reader even thanked Flynn and assistant editor Carolyn Ryan in an email, writing, “I can’t imagine the heart-wrenching, soul-searching process you must go through each and every day. You are telling the stories that need to be told. . . . It is important and brave.”

For The Post, the decision not to publish the photo in its print edition was largely a logistical one, according to Emilio Garcia-Ruiz, managing editor for digital. “We were unable to get a Washington Post-level story written in time to meet print deadlines [Tuesday night] so we didn’t consider it” for display on the front page, he said. The Post, however, published the photo and AP story online on Tuesday and wrote several follow-up stories on Wednesday.

Le Duc, a crime reporter, told the Guardian, “I’ve seen a lot of bodies — and a lot of drownings. . . . You get numb to it, but when you see something like this, it resensitizes you.

“Will it change anything?” she asked. “It should. These families have nothing, and they are risking everything for a better life. If scenes like this don’t make us think again — if they don’t move our decision-makers — then our society is in a bad way.”