After nearly 3 years and the deaths of 39 bloggers, atheist writers, gay rights activists and other religious and secular minorities Bangladesh police believe they have identified the leaders of the groups responsible, reports The New York Times.

According to the chief of the police counterterrorism unit, 2 separate Islamic militant groups formed in response to the 2013 Shahbag Movement. The movement was inspired by a group of bloggers and culminated in mass protests calling for the end to religious politics in Bangladesh and for those accused of war crimes, dating back to the 1971 war for independence, to be prosecuted.

While Bangladesh was under a military government these war crime trials were largely ignored, but after the reestablishment of democracy in 2009 they came back to the forefront, angering Islamic extremists. Since the trials resumed, 4 of the last 5 convictions, which all resulted in execution, were leaders in Bangladesh’s largest Islamic political party.

According to the police chief, the aim of these groups was to choose and murder targets which would gain them support in Bangladesh’s Muslim majority, or at least appear justifiable to those outraged after the groups publicised pieces of the secular writings. One of the groups, located in Northern Bangladesh, was far less tactical in its targets and as a result angered its local population, allowing police to round-up many of its members.

They may have actually succeeded in some of their aims, the secular government has urged writers to refrain from criticizing Islam and warned of criminal action against those advocating for non-traditional sex. Many bloggers and secular writers have also fled the country or resorted to safe houses.

Authorities in Bangladesh now believe they have identified the leaders of the two most prominent groups and are preparing to take them into custody. The hope is that once these leaders, who recruit, indoctrinate and train the group’s members, are arrested, the attacks finally be stopped.