The attack in Jakarta on Thursday was as much a battle of images and perceptions as it was an exchange of gunfire and explosions.

Indonesia's counterterrorism effort has had significant success over several years in degrading the capabilities of domestic militants to launch deadly attacks, creating a sense that the battle against Islamic militants was largely won. On one level, the attack in Jakarta was an attempt to change that narrative.

The attackers captured worldwide publicity by carrying out the first deadly attack in Jakarta since 2009, weeks after authorities said they knew of a credible threat. Yet the low death toll — two victims and five attackers — highlighted their weaknesses and the ability of security forces to respond rapidly.

Here's a look at other ways in which Islamic militants and the Indonesian government are handling the optics of the attack, and the broader issue of extremism in the world's largest Muslim-majority country:

___

INSTILLING FEAR

Above all else, the brazen nature of the attack in a busy commercial district in broad daylight was meant to terrorize and sow panic. Creating an atmosphere of fear and insecurity in a city of 10 million amplifies the impact of the attack well beyond the actual loss of life. Another intention is to galvanize supporters, creating momentum for further attacks.

Jakarta, meanwhile, presented itself as a city unbowed by extremist attacks. Newspapers carried bold front-page headlines declaring the country united in its condemnation of the bombings.

___

LINKS TO ISLAMIC STATE GROUP

Police say the attack was linked to the Islamic State group, and that one of the five attackers had a black IS flag.

Under siege from a sustained counterterrorism effort, Indonesia's militants have been seen as increasingly weak and fragmented. Their identification with the Islamic State group in distant Syria is an attempt to change those perceptions by linking to a network known for brutal, headline-grabbing attacks. Whether or not IS had a direct role in the attack, supporters of the group were quick to claim responsibility online, conveying a message that its international reach is growing.

___

FAST RESPONSE

Counterterrorism forces apparently did not anticipate Thursday's attack, though authorities announced last month that they knew of a credible threat. Security personnel, however, were able to respond rapidly. That was partly luck — police happened to be in the area on other business — but it still bolstered the image of security forces and government.

Indonesia's president Joko "Jokowi" Widodo rushed to the scene from another part of Java, one of Indonesia's main islands and home to the capital Jakarta. With a forceful condemnation and an appeal to national unity, he capitalized on an opportunity to project strength. Jokowi has struggled to assert his authority since being elected as a maverick candidate in July 2014.

___

SOMEONE ELSE'S FAULT

Police were quick to draw a link with IS, saying the attackers were linked to Bahrun Naim, an Indonesian fighter in Syria. While that could play into the aims of the attackers, it could also pin responsibility on foreign influences and skirt questions about Indonesia's domestic counterterrorism strategy. Authorities have concentrated on hunting down the remaining most wanted Indonesian militants in remote locations while an IS-inspired network developed in Jakarta's suburbs.