The new president of El Salvador on Monday took responsibility for the June deaths of a father and daughter who drowned crossing the Rio Grande in a bid to reach the United States, saying the onus is on his government to make the country a safer place -- and one where migration is "an option, not an obligation."

A photograph from the Mexican side of the river showing the body of Oscar Martinez and his daughter, Valeria, lying face down with Valeria's arms still wrapped around her father’s neck shocked the world late last month amid an already heated debate about illegal immigration in the US.

President Nayib Bukele, who took office a month ago with the promise of making El Salvador a safer and better place, told the BBC in an interview published Monday his country is to blame for the deaths. He said his government is responsible for fixing the problems that have forced hundreds of thousands of people to flee in the first place.

IMAGE OF DEAD FATHER, DAUGHTER AT US-MEXICO BORDER DRAWS REACTIONS FROM AROUND THE WORLD

FILE - In this March 12, 2019 file photo, El Salvador's President-elect Nayib Bukele speaks to the press at Mexico's National Palace after meeting with the President Andres Manuel Lopez Obrador in Mexico City. (AP Photo/Marco Ugarte, File)

FILE - In this March 12, 2019 file photo, El Salvador's President-elect Nayib Bukele speaks to the press at Mexico's National Palace after meeting with the President Andres Manuel Lopez Obrador in Mexico City. (AP Photo/Marco Ugarte, File)

“People don’t flee their homes because they want to, people flee their homes because they feel they have to,” Bukele told the BBC. “Why? Because they don’t have a job, because they are being threatened by gangs, because they don’t have basic things like water, education, health.”

He continued: “We can blame any other country but what about our blame? What country did they flee? Did they flee the United States? They fled El Salvador, they fled our country. It is our fault.”

CANADIAN NEWSPAPER PUBLISHER CUTS TIES WITH ARTIST BEHIND CONTROVERSIAL TRUMP CARTOON

The father and daughter were swept away by the current in the Rio Grande between Matamoros, Mexico, and Brownsville, Texas.

Martinez, 25, and his wife, Tania Vanessa Avalos, 21, had been living with his mother and reportedly concluded the couple's jobs at a pizza parlor and as a restaurant cashier would never provide enough money to be able to purchase a modest home in their suburb of San Salvador. That dream of owning their own home led the family to set out for the U.S., Martinez's mother, Rosa Ramirez, told reporters.

Oscar's and Valeria's bodies were returned to El Salvador on Monday for an expected burial at a private ceremony in San Salvador.

RUSSELL WILSON REACTS TO IMAGE OF DEAD MIGRANT FATHER, DAUGHTER: 'THE AMERICAN DREAM ... IT'S BECOME A NIGHTMARE'

In his interview with the BBC, Bukele went on to say that while he did condemn the treatment of migrants in the United States and Mexico, it was his belief El Salvador had to “focus on making our country better, making our country a place where nobody has to migrate.”

“I think migration is a right, but it should be an option, not an obligation,” he said. “And right now it’s an obligation for a lot of people.”

Bukele told Sky News his government will work to "make our country more prosperous and create jobs."

"So if people have an opportunity for decent jobs, a decent education, a decent health care system and security, I know that forced migration will be reduced to zero," he said.

CLICK HERE TO GET THE FOX NEWS APP

A total of 283 migrant deaths were recorded along the 2,000-mile U.S.-Mexico border last year. The official death toll so far this year has yet to be released.

Migrant families have been coming over the border in unprecedented numbers in recent months, reaching a peak in May, when 84,000 adults and children traveling together were apprehended. Nearly 500,000 illegal immigrants have been detained at the border since the start of 2019, resulting in overcrowding in U.S. holding centers.

Fox News' Greg Norman and the Associated Press contributed to this report.