President Obama on Monday condemned an attack by al Qaeda-linked militants on an upscale mall in Nairobi as a “terrible outrage” and vowed to stand in solidarity with the Kenyan government and other nations to fight terror.

“We stand with them against this terrible outrage that’s occurred, we will provide them with whatever law enforcement help that is necessary,” Obama said. He added that he had spoken over the weekend with Kenyan President Uhuru Kenyatta about the attack and the cooperation the United States is providing in the response.

“The United States will continue to work with the entire continent of Africa and around the world to make sure that we are dismantling these networks of destruction,” Obama said of the Somali terrorist group al Shabab, an al Qaeda affiliate behind the attack.

The group invaded the mall on Saturday, killing at least 62 people, injuring hundreds and holding scores hostage.

Kenyan security forces on Monday afternoon said they are gaining control of the mall, two days after the siege began.

Kenya's Interior Minister Joseph Ole Lenku said the evacuation of hostages “has gone very, very well” and Kenyan officials are “very certain” that there are few if any hostages left in the building.

Obama made his remarks at the beginning of a meeting with Nigerian President Goodluck Jonathan at the beginning of the United Nations annual general assembly meeting in New York. He said the two countries have a common interest in helping Nigeria bring electricity to rural areas.

“Nigeria’s an important energy producer, but it’s also an important energy consumer,” Obama said, citing the attention he gave to improving power availability in his trip to Africa at the beginning of the summer.

Obama also referred to “some significant challenges on the security front in Nigeria,” saying the United States wants “to be cooperative” in helping the country deal with threats in the north of the country in a way that’s consistent with human rights.

Jonathan said he appreciated the help from the United States, and called on Obama to continue helping his country and the continent continue working on energy production, improving elections and boosting the economy.

Nigeria, he said, is Africa’s second largest economy and its largest trading partner is the United States.

“For you to fix the world , you must fix Africa. For you to fix Africa, you must fix Nigeria,” Jonathan told Obama.