Retired neurosurgeon Ben Carson applauded the release of four American prisoners who had been held by Iran — but the Republican presidential hopeful tore into the Obama administration’s diplomatic handling of the Iran’s nuclear program.

"I am very pleased that four American citizens, who were illegally imprisoned by Iran in flagrant violation of longstanding international human rights norms, have finally been released,” Carson said in a statement, adding that he is “overjoyed” for the prisoners and their families.

But Carson added that the nuclear deal between the Iranian government and the United States continued to present a danger to American national security interests.

“[T]he fact remains that President Obama's nuclear agreement with Iran is fatally flawed and gravely jeopardizes the national security interests of the American people, our ally Israel and other peaceful nations in the Middle East and around the world,” Carson said.

Carson was once a top tier candidate for the Republican nomination but has seen his support fall sharply in recent months. His decline was largely precipitated by intense scrutiny over his grasp of national security issues following the terrorist attacks in Paris San Bernardino, Calif.