OXON HILL, Md. — Former Texas Gov. Rick Perry on Friday blasted President Barack Obama's record on foreign policy, calling for a harder-line approach in the Middle East and accusing the administration of "making grave calculations that make the world less safe."

Speaking on the second day of the annual Conservative Political Action Conference, the likely Republican presidential contender said, "Our country has entered a time of testing, and our political leadership has failed the test."

"At no time in the last 25 years has the future been more uncertain and the world more dangerous than it is today," he said, calling the Islamic State group seizing territory in the Middle East "the worst threat to freedom since communism."

Perry, who has been studying up on foreign policy and trying to reintroduce himself to voters after a poorly received 2012 run, also took a hard line on Iran, saying that barring the country from developing nuclear weapons should be non-negotiable.

"Here's the simple truth about our foreign policy: Our allies doubt us and our adversaries are all too willing to test us," he said.

In addition to touting job growth during his tenure as governor, Perry also spoke about his efforts to secure his state's border with Mexico and said any conversation about immigration reform has to begin with border security.

"For the world to be safer, America must be stronger. And for America to be safer, our border must be secured," he said.