A handout photo made available by Syria's Arab News Agency (SANA) shows Syrian President Bashar Assad (C) inspecting a unit of the Syrian armed troops in the Damascus’ suburb of Darayya, Syria. (SANA / HANDOUT/EPA)

Syrian President Ba­shar al-Assad put on a show of confidence Thursday, releasing photos of a visit to a war-scarred suburb of the capital and praising his troops’ recent battlefield gains, even as a massive explosion in the central city of Homs offered a reminder of the rebels’ ability to strike back.

Assad looked relaxed in a suit and open-collared shirt, according to footage and images released by state media, as he visited with soldiers in the suburb of Darayya during a rare public appearance outside Damascus to mark Syria’s armed forces day. Talking to the troops there, he commended the army for its progress against opposition forces in central and southern Syria.

The cracks in Assad’s control of the country were underscored, however, as a blast struck a government-controlled area of Homs, sending a huge fireball into the air and killing at least 40 people, according to opposition groups, some of which said that tally included only soldiers, with scores more dead. Activists also said that footage and images of Assad’s visit to Darayya, which the government claims it captured this year, were taken on its outskirts and the area remains contested.

After nearly 21 / 2 years, the conflict in Syria has claimed more than 100,000 lives, according to the United Nations, and devastated the country’s economy. In a statement released Thursday to coincide with the 68th anniversary of the creation of the armed forces, Assad described it as the “most barbaric war” in modern history and touted his troops’ ability to prevent the government’s ouster far longer than many had expected.

“You have stunned the whole world with your steadfastness and your ability to face challenges and score achievements,” he said.

The location Assad chose to visit was symbolic. Once a bastion of the revolution, Darayya was the site of an alleged massacre by Assad’s forces last year as hundreds of bodies — some showing signs of summary execution, according to the United Nations — were found after government troops advanced.

Sama Masoud, an activist based in the Damascus suburbs, dismissed Assad’s visit as a propaganda stunt, saying Darayya is split, with the government and rebels each controlling roughly half.

“The area where the photographs were taken is meters away from the gates of the Mezzeh military airport on the western side, the areas of regime control,” she said, adding that it is protected from snipers by high buildings and near a long-standing government checkpoint.

With the assistance of Shiite militias from Iran and Lebanon, Assad has tightened his grip on central Syria, pushing rebels out of the key Homs stronghold of Khaldiyeh this week and penning them more tightly inside a few besieged neighborhoods.

Thursday’s explosion occurred at a weapons depot in the Wadi al-Dahab neighborhood, known for its staunch support of the government, activists said. The Britain-based Syrian Observatory for Human Rights said it followed a volley of rocket fire directed at the area and nearby Akrama and al-Zahra, home to a large proportion of Alawites, the minority Shiite sect to which Assad belongs. It put the death toll at 40, with at least 120 injured.

Abu Rami al-Homsi, a spokesman for the Syrian Revolution General Command activist network, said that death toll only included soldiers, and that fighting had intensified since the blast.

“The situation has escalated very rapidly,” he said, citing an upsurge in the bombardment of rebel-held areas of the city.