HANOI — President Trump on Thursday defended North Korean leader Kim Jong Un over the death of American college student Otto Warmbier, whose family says he was “brutally tortured” while imprisoned in North Korea and died in 2017 after being flown back to United States in a coma.

The president condemned the “brutality of the North Korean regime” following Warmbier’s death at 22, but he took a softer stance toward Kim at the conclusion of their second summit.

“I don’t believe he would have allowed that to happen,” Trump said. “It just wasn’t to his advantage to allow that to happen.”

Trump said that he spoke to Kim about the death of Warmbier — whose family has called it a murder — and that Kim “feels badly about it.” He said the North Korea leader, who rules the country with an iron grip, knew about the case but learned about it only after the fact because, Trump suggested, “top leadership” might not have been involved.

“He tells me he didn’t know about it, and I take him at his word,” Trump said.

Richard Cullen, the attorney for Fred and Cindy Warmbier, who in December won a $501 million judgment against North Korea for the death of their son, said the couple probably will not say anything publicly about the president’s comment.

Trump’s defense of Kim mirrors his willingness to take the word of autocrats in other cases despite the findings of his own government or experts, particularly when confronting the leader is not what Trump sees as in his political interest.

Trump has not agreed with his intelligence community’s assessment that Crown Prince Mohammed bin Salman — who as the de facto leader of Saudi Arabia has forged an alliance with the administration — ordered the assassination of journalist Jamal Khashoggi, who was murdered inside the Saudi Consulate in Istanbul in October. Khashoggi, a Washington Post contributing columnist, was reportedly cut up with a bone saw, and messages later showed that the crown prince had plotted in the past to kill him. The Saudi government has blamed the operation on a rogue band of operatives who were sent to Istanbul to bring Khashoggi back to Saudi Arabia.

Trump has repeatedly said that the crown prince has denied any involvement in Khashoggi’s death while emphasizing his own view that preserving the United States’ relationship with Saudi Arabia is most important.

“Maybe he did and maybe he didn’t!” Trump said of whether Mohammed knew of the plan to kill Khashoggi. The remarks were included in an October news release defending his administration’s handling of the situation.

And Trump has sided with Russian President Vladimir Putin over his denial that Moscow interfered in the 2016 presidential election — even though the U.S. intelligence community has concluded that Russia did interfere as part of an effort to sow discord and help Trump.

American student Otto Warmbier is escorted at the Supreme Court in Pyongyang, North Korea, on March 16, 2016. (Jon Chol Jin/AP)

“I have great confidence in my intelligence people, but I will tell you that President Putin was extremely strong and powerful in his denial today,” Trump said standing beside the Russian president during a joint news conference in Helsinki in July.

Trump’s remarks about Warmbier and Kim drew bipartisan criticism. Rick Santorum, a former Republican senator from Pennsylvania, said that Trump’s acceptance of Kim’s denial of responsibility was “reprehensible.”

“He gave cover, as you said, to a leader who knew very well what was going on with Otto Warmbier,” said Santorum on CNN, adding, “I am disappointed, to say the least, that he did it.”

“Walking away from the summit was better than making a bad deal,” he wrote in a Thursday morning post. “It’s also the result of a poorly planned strategy. But accepting Kim’s denial of involvement in Warmbier’s death? Detestable, and harkens back to Trump’s duplicitous acceptances of denials from other dictators.”

Warmbier, a University of Virginia student from Ohio, was detained in Pyongyang after participating in an organized tour in December 2015 and was held for 17 months, after being charged with spying for the United States and being coerced into making an on-camera confession. His parents have stated that all the charges against him were untrue. Warmbier returned to his hometown of Cincinnati in a coma and died a few days later.

Trump said at the time that he was incensed by the death. He forged a relationship with the Warmbier family, even meeting with them in the Oval Office, and introduced them to a rousing ovation at his 2018 State of the Union address.

“We need only look at the depraved character of the North Korean regime to understand the nature of the nuclear threat,” he said, with Warmbier’s tearful family looking on as he described the regime’s grisly actions.

Fred Warmbier accompanied Vice President Pence as part of the U.S. delegation to the Opening Ceremony of the Winter Olympics in PyeongChang, South Korea, in February 2018.

In a statement announcing a lawsuit against the government of North Korea in April 2018, Warmbier said his son was “taken hostage, kept as a prisoner for political purposes, used as a pawn and singled out for exceptionally harsh and brutal treatment by Kim Jong Un. Kim and his regime have portrayed themselves as innocent, while they intentionally destroyed our son’s life.”

As his relationship has warmed with Kim, Trump has played down human rights abuses in North Korea and has infrequently brought up Otto Warmbier’s death.

Trump has said to advisers that human rights are not a key concern when negotiating with North Korea, and human rights advocates told The Washington Post in December that they have lost momentum with the administration.

At the end of his first summit with Kim in June in Singapore, when asked about Warmbier, Trump described his death as a turning point that helped lead to a ratcheting-down of tensions with Kim and a move toward negotiations over its nuclear program.

“I think without Otto this would not have happened,” he said. “Something happened from that day — it was a terrible thing. It was brutal. A lot of people started to focus on what was going on, including North Korea. I really think that Otto is someone who did not die in vain.”

On Thursday, Trump jumped in when an American journalist asked Kim about his human rights record, saying they would discuss it privately.

“You’ve got a lot of people,” Trump said of North Korea during Thursday’s news conference. “Big country, a lot of people. And in those prisons and those camps, you’ve got a lot of people. And some really bad things happened to Otto. . . . But [Kim] tells me he didn’t know about it.”