Kamilia Lahrichi and Gregg Zoroya

USA TODAY

BUENOS AIRES — President Obama expressed sorrow for the victims of the Brussels attacks and vowed Wednesday to fight the Islamic State until it is destroyed, speaking at a news conference with Argentinian President Mauricio Macri.

"We will continue to go after ISIL until it's removed from Syria and Iraq and destroyed," Obama said, using an acronym for the Islamic State.

Macri also voiced his country's support for Brussels. "I would like to convey my solidarity with the families of the victims," he said. "Argentina once again condemns this kind of terrorist attack."

Obama, on his first visit to Argentina to strengthen ties with South America's third largest economy, said his top priority is to defeat the Islamic State.

"There's no more important item on my agenda than going after them and defeating them. The issue is how do we do it in an intelligent way," Obama said.

Muslim surveillance would be counterproductive, Obama says

He added that "carpet-bombing" the Islamic State would not defeat the terrorists, but instead could serve as a recruitment tool for the militant group.

Obama also announced during the news conference that U.S. intelligence agencies will declassify documents that shed light on the United States' role during the Argentine military's infamous "dirty war" from 1976 to 1983.

"We are grateful for this gesture," Macri said.

Later in the day, Obama laid a wreath at the Buenos Aires Metropolitan Cathedral, where Pope Francis had served as archbishop. At a town hall meeting with students and professors, Obama said that despite the terrorist menace of the Islamic State, "the world is far less violent than it was 20 or 50 years ago."

Photos: Obama in Argentina

To bring about further progress it's important "that we listen to each other and understand our differences," Obama said at the town hall. That means "treat somebody the same as you would want to be treated."

Obama attempted to speak Spanish, awkwardly, saying at one point, "Somos un equipo" (we are a team) twice. He then added, "I've got to practice my Spanish."

The discussion also covered academic collaboration between Argentina and the United States, plus health issues such as the Zika virus and other diseases that Obama said could be prevented with small investment and economic development.

Macri, who took office in December, is a center-right politician who has instituted reforms friendly to investments to expand economic opportunity, a change from his more leftist predecessors.

”President Macri is a man in a hurry because he has moved rapidly on so many of the reforms that he has promised," Obama said.

Macri hosts a state dinner for Obama Wednesday night with 400 guests.

In addition to signing an agreement to bolster trade, the two presidents discussed efforts to fight climate change. Both nations agreed to reduce hydro-fluorocarbons, cut aviation emissions and increase the use of renewable energy.

Obama on Thursday is scheduled to visit Bariloche and Patagonia, as thousands plan to protest in Buenos Aires on the 40th anniversary of the 1976 military coup that the U.S. initially supported. Resentment still lingers over the tens of thousands of people who disappeared or were killed under military dictatorship.

Obama’s first visit to Argentina stirs controversy

Zoroya reported from Arlington, Va.​ Contributing: Oren Dorell in Washington.