While the world has its fair share of hot spots, from Afghanistan to Venezuela to Yemen, former Secretary of Defense Jim Mattis said at an event in New York on Tuesday that Pakistan topped his list of most dangerous countries.

“Of all the countries I’ve known, I consider Pakistan to be the most dangerous,” Mattis wrote in his latest book, “Call Sign Chaos: Learning to Lead.”

“This is a much worse problem, I think, than anyone is writing about today,” he said.

Mattis’ career took him to Afghanistan, which shares a porous border with Pakistan. In his book, he writes that Pakistan “views all geopolitics through the prism of its hostility toward India,” which he said had shaped its policy in Afghanistan to the detriment of Afghans and the rest of the world. Many detractors, however, say Pakistan has provided haven to members of the Afghan Taliban. It also has provided material support to Al Qaeda and notably harbored the Qaeda leader Osama bin Laden.

Read more: Here's what life is like on the border between India and Pakistan, one of the world's most disputed regions

Pakistan has its own share of extremist groups, including the Tehrik-i-Taliban Pakistan, which aims to overthrow the Pakistani government and establish a caliphate.

"We can't have the fastest-growing nuclear arsenal in the world falling into the hands of the terrorists breeding in their midst," Mattis writes in "Call Sign Chaos."

"So when you take the radicalization of society, and you add to it the fastest-growing nuclear arsenal, I think, in the world, you see why one of the points I would make that we need to focus on right now is arms control and non-proliferation efforts," he said.

Michael Morell, the former acting director of the CIA, expressed the same concerns to Axios last year, saying: "This anti-state jihadist extremism is growing in Pakistan, creating the nightmare society down the road - an extremist government in Islamabad with nuclear weapons."

While US President Donald Trump recently hosted Pakistani Prime Minister Imran Khan at the White House, Mattis described the relationship between the US and Pakistan as "very twisted."

Under the Trump administration, the US has relied on Pakistan to keep withdrawal talks in Afghanistan going, NPR reports, but it also pulled millions of dollars in military funding and accused Pakistan of harboring terrorists, further eroding the relationship between the two countries.