Ravi Agrawal is CNN's New Delhi Bureau chief. Follow him on Twitter: @RaviAgrawalCNN .

New Delhi (CNN) Bangladesh has a number of things going for it: its economy is growing, it's a democracy with a youthful population, and it's blessed with fertile lands.

It is also home to almost 150 million Muslims, and up until recently steered clear of the kind of radicalism that has plagued other parts of the world. But unfortunately there are ominous signs that this is changing.

For more than two years, a spate of brutal murders has rocked the South Asian nation. At first the killings had a clear pattern, targeting well-known secular writers in the capital, Dhaka. The attacks seemed designed to silence those who dared to criticize Islam.

One of the most high-profile of these -- the murder of the Bangladeshi-American writer Avijit Roy in 2014 -- took place right outside Dhaka's annual book fair.

Then in April this year, a well-known LGBT activist and his friend were murdered while they were at home.

In recent weeks these attacks extended into the countryside, increased in frequency, and targeted everyone from university professors to a seemingly random selection of Hindus, Christians, Buddhists, and even Sufi Muslims.

JUST WATCHED Man arrested in hacking deaths of 2 LGBT activists Replay More Videos ... MUST WATCH Man arrested in hacking deaths of 2 LGBT activists 02:26

The death toll has now risen past 40.

The hand of ISIS?

One clear thread connecting the murders is the barbaric and medieval mode of attack: machetes.

But who is masterminding the killings?

So-called Islamic State (ISIS) has claimed a number of the attacks through its media affiliates, but the Bangladesh government has consistently denied any ISIS presence in the country. Other attacks have been claimed by local Islamist groups. Police have said that most of the suspected attackers were members of Jamaatul Mujahideen Bangladesh, or JMB -- a banned Islamist group.

There's no clear consensus on the veracity of the claims, even amongst the region's top terror analysts.

"ISIS does not go around stabbing individuals in marketplaces," said Ajai Sahni, Executive Director of the South Asia Terrorism Portal.

Sahni said ISIS-affiliated media may be claiming some of the attacks because it makes the group's reach seem larger. "It wants to span the globe," he says. "But if ISIS is involved where is the real weaponry? Where are the trained and battle-hardened fighters?"

JUST WATCHED Blogger murders in Bangladesh Replay More Videos ... MUST WATCH Blogger murders in Bangladesh 06:11

But terrorism expert Sajjan Gohel of the Asia-Pacific Foundation said the JMB can now be seen as closely aligned to ISIS.

"JMB has targeted foreigners, professors, and academics," he said. On the other hand, the other local terror outfit, Ansarul Bangla Team, or the ABT, has mostly targeted bloggers and atheists. Gohel saw the ABT as aligned more closely with the recently launched al Qaeda in the Indian Subcontinent (AQIS).

If Gohel is right then Bangladesh could become -- or could already be -- a battleground for a proxy war between ISIS and al Qaeda. The motive and payoff is clear: a foothold in a country with the world's fourth-largest Muslim population. It also shares a border with an even bigger prize in India.

Things could get worse. Gohel pointed to a recent issue of ISIS's online propaganda magazine, Dabiq, for clues. "ISIS specifically mentioned they want to carry out more high profile attacks in Bangladesh. The next stage could be bigger and better coordinated," says Gohel. "And Bangladesh's government is in a total state of denial."

But why machetes?

"Stabbings and hackings aren't new," said Sahni. "In a certain measure Bangladesh has long had a political culture of low grade violence. But it's now been crystallized into something much bigger -- and that's in large part because it's being associated, rightly or wrongly, with the ISIS brand."

Even the smallest of attacks have a payoff.

"For terror groups any attack is an attack worth doing," said Gohel. "It's the oxygen of publicity that fuels them."

JUST WATCHED Bangladeshi bloggers under attack Replay More Videos ... MUST WATCH Bangladeshi bloggers under attack 03:29

Branding seems almost essential for smaller terror outfits looking to make a splash, said CNN's terrorism analyst Peter Bergen.

"Former members of the Taliban have also self-identified as ISIS," he pointed out, even when they have no real links to ISIS. "The ISIS connection makes them a bigger and badder version of themselves."

Politics and finger-pointing

If you ask the government, the killings have clear motives and culprits.

Talking to CNN last month, Bangladesh's Information Minister Hasanul Haq Inu pointed a finger loosely at the opposition Bangladesh Nationalist Party (BNP) and its ally Jamaat-e-Islami (JI) -- the country's largest Islamist party.

But when he talked again to CNN earlier this month, Inu had honed his accusation into a movie analogy.

"The answer is very simple," he said, responding to a question about who was masterminding the spate of ongoing attacks. "The Producer is the BNP. The Director is JI. The small actors on the ground are ABT, JMB, and other militant Islamist networks."

He said any claims by ISIS were "fictitious and false," pointing instead to what he said was a sustained campaign by the opposition BNP to destabilize Bangladesh.

JUST WATCHED Bangladesh arrests over 5,000 to curb killings Replay More Videos ... MUST WATCH Bangladesh arrests over 5,000 to curb killings 01:17

The BNP's spokesman completely disagreed.

"We are a political party with democratic values and norms," said Ruhul Kabir Rizvi. "The government's main aim is to trash the opposition. They want to establish a one-party political system."

The BNP does seem decimated.

By Rizvi's account more than 2,700 BNP members have been arrested in June as part of the government's drive to put an end to the killings. In all, more than 14,000 arrests have been made, but experts say only a few hundred of those are militants.

In a press release last week Human Rights Watch called the arrests arbitrary and without proper evidence of a crime.

Photos: Bangladeshi police escort arrested men in Dhaka on June 12, 2016. Over 14,000 people, including suspected ordinary criminals, have been detained after police launched a controversial anti-militant drive across the Muslim-majority nation following a spate of gruesome murders. Hide Caption 1 of 7 Photos: Prime Minister Sheikh Hasina vowed to catch "each and every killer." Hide Caption 2 of 7 Photos: The arrested men try to talk with relatives and lawyers from a prison van outside court. Hide Caption 3 of 7 Photos: A detained Bangladeshi man looks out from inside a police prison van. Hide Caption 4 of 7 Photos: Relatives of men arrested in the nationwide crackdown wait for their release outside a Dhaka court. Hide Caption 5 of 7 Photos: Bangladeshi policemen stand guard outside the Dhaka Central Jail. Hide Caption 6 of 7 Photos: A man is frisked at a police check-post in Gulshan, Dhaka on June 10. Hide Caption 7 of 7

"You can't arrest 14,000 people in the course of five days and claim they are legitimate arrests," said Tejshree Thapa of Human Rights Watch. "Why have they not been produced before a magistrate? Why have they not been remanded? Many of the BNP's top leaders have fled the country. They are terrified."

Longer-term impact

Bangladesh watchers are not only worried about potential misuse of power, but also about the longer-term impacts of a weakened opposition.

"The BNP is in total disarray," said William Milam, who served as U.S. Ambassador to Bangladesh from 1990 to 1993, and recently returned from a visit to Dhaka. "They are spending all their time claiming innocence and dodging the government. And a weakened opposition is contributing to what seems more and more like a one-party system."

The BNP's leader and two-time former Prime Minister Khaleda Zia is battling charges for alleged corruption as well as conspiring to bomb a public bus during an anti-government protest last year. Zia has said the charges are politically motivated.

The next national elections in Bangladesh are scheduled for 2019.

"Whatever is going on is really tragic," said Milam. "People are being killed for no particular reason."

What's next?

The Bangladeshi government looks set to press on with mass arrests.

Asked to explain why the attacks continue to take place -- despite recent crackdowns -- Information Minister Inu said the militants have clearly gotten more desperate.

"Radical elements are choosing unprotected soft targets to create an impression that they are active," he said. "But they are weak now."

While critics point to an increased frequency of attacks, Inu said it's telling the attacks have shifted from the big cities to more rural and lower-profile areas.

The BNP's Rizvi says the government needs to find the right culprits.

"This is the holy month of Ramadan," he said. "The people of Bangladesh are very afraid of this government and are wondering why they are playing games."

ISIS recently called for a worldwide call to arms, during this holy period.

There is also the worry that some of the machete murders could be "copycat" killings -- regular murders disguised to be seen as a terror attack. "I wouldn't rule out the theory," said Milam. "There is a clear atmosphere of impunity.

Some of the government's plans seem almost comical. Police in the Western Bangladeshi district of Magura have started arming villagers with bamboo sticks and whistles.

"In each village, a team of 20 people will be selected," said Mohammad Tariqul Islam of the Magura District Police to CNN. "The idea is to increase awareness and make villagers more vigilant against militants."

But ultimately the real verdict on the government's policies will depend not on who argues the best case but whether the attacks actually stop. Until then the ugly headlines will continue to dent Bangladesh's reputation around the world.