DHAKA, Bangladesh — Last month, United States officials told Bangladeshi authorities that they had information suggesting that terrorists linked to the Islamic State were preparing to ramp up activity within Bangladesh's borders.
In the days that followed, a series of unusual attacks and threats seemed to substantiate the warnings. An Italian aid worker was fatally shot in this city's diplomatic zone. A Japanese agriculturalist was shot in the north of the country. Last Saturday, a bomber sneaked into a huge gathering of Shiite Muslims, weaving through rings of police officers before killing a teenage boy and wounding dozens of other people.
After each attack, claims of responsibility by the Islamic State appeared on social media accounts believed to be used by radicals.
But Sheikh Hasina, Bangladesh's prime minister, has responded to the developments with suspicion and outright skepticism. Even as foreign embassies informed their citizens that they could become terrorist targets, Bangladeshi officials have insisted that the Islamic State, also known as ISIS or ISIL, does not exist in their country. They have noted, pointedly, that the United States has promulgated flawed intelligence in the past, as in the run-up to the Iraq invasion.
Instead, Ms. Hasina has described the episodes as a conspiracy by domestic opposition leaders to tarnish her government's reputation.
“Bangladesh is moving ahead and it'll do so,” she said on Wednesday. “Let me say one thing: The march forward of Bangladesh can't be stopped by hurling two bombs or five eggs. Those who are thinking this are making a mistake.”
The disconnect between Bangladesh and foreign intelligence agencies has confused Bangladeshis and foreigners alike, and could complicate efforts to prevent the expansion of international terrorist organizations in South Asia. Their emergence here could be devastating, derailing years of steady economic growth and potentially spilling into India and Pakistan.
For decades, Bangladesh has grappled with a network of domestic extremist cells, some with links to opposition groups. After a period of dormancy, they appeared to have regrouped this year, carrying out four assassinations of intellectuals who have spoken out against fundamentalist Islam. At the same time, foreign security agencies have tracked Bangladeshi expatriates who are active in the Islamic State, as both recruiters and fighters, in London; Melbourne, Australia; and other cities.
Command-and-control links between those groups would introduce new dangers for Bangladesh, a democracy with a population of about 160 million, nearly all Sunni Muslim.
“We are taking the Islamic State claim very seriously,” said a senior diplomat in Dhaka, speaking on the condition of anonymity in line with protocol. “We see it unfolding around the world.”
So far, evidence of those links is fragmentary. The police here have arrested more than 30 followers of the Islamic State, mainly students from prosperous families who were planning to travel to Syria or Afghanistan to fight, said Monirul Islam, joint commissioner of the Dhaka Metropolitan Police. They also arrested a recruiter based in London “who was here to recruit boys,” Mr. Islam said.
Ali Riaz, an expert on South Asian politics at Illinois State University, said that he was “seriously skeptical” that major jihadi groups had an “organizational presence” in Bangladesh, but said that homegrown cells were eager to form affiliations.
“If opportunity arises and pathways are found, these local groups will become the I.S. franchise in no time,” he said.
The story of last month's warning points to deep-rooted mutual suspicion between Bangladesh and foreign intelligence agencies, even as they try to build cooperation on counterterrorism.
Around a month ago, intelligence agencies from the so-called Five Eyes alliance, which includes Australia, Britain, Canada, New Zealand and the United States, received information that militants were planning an attack on foreigners in Bangladesh. On Sept. 25, Australia updated its travel advisory to report “reliable information of a possible militant attack against Australians,” an urgent matter because its national cricket team was set to fly to Dhaka to play Bangladesh in a test match.
The target was believed to be the Glitter Ball, a boozy annual costume party popular with foreigners, who in the past have organized teams dressed as Elvis impersonators, mermaids or the crew on “Star Trek.” Britain and the United States issued similar warnings to their citizens, based on the same information.
On Sept. 27, Bangladesh's home minister dismissed Australia's “militancy fears” as “baseless.” American officials, for their part, conveyed a description of the threat to officials traveling with Ms. Hasina, then in New York to address the United Nations General Assembly.
She found the warnings frustrating and inconclusive, said Gowher Rizvi, an aide who accompanied her on the trip. He said the United States shared “no actionable intelligence” and did not say where the information originated.
“We have a long history of sharing intelligence,” he said in an interview. “Why, on this occasion, are you taking unilateral actions and not sharing information?”
He added that, in the past, “the credulity of the world has also been tested” by flawed intelligence passed on by the United States, citing the prewar claims of weapons of mass destruction in Iraq.
In an interview, Mr. Rizvi first said the American briefing occurred on Sept. 25 or 26; he later said it was early on Sept. 28.
It was the evening of Sept. 28 when an Italian aid worker, Cesare Tavella, was shot while jogging in Dhaka's diplomatic zone; hours later, a claim of responsibility appeared on a suspected Islamic State account on the mobile messaging app Telegram and on two suspected Islamic State Twitter accounts, according to the SITE Intelligence Group, which monitors radical Islamic propaganda.
Bangladeshi officials said the social media messages were not authentic, as they did after claims of responsibility for the killing of the Japanese citizen and the attack on the Shiite gathering.
Mr. Rizvi said that it would be “foolhardy” to discount the possibility that the Islamic State was present in Bangladesh, but that he found it unlikely. He said that a competing theory was that domestic opposition forces were seeking to throw Ms. Hasina off balance.
“Someone in the rank and file might have said, 'Let's stir up some confusion, this government is getting a lot of good press,' ” he said. “This government is getting a lot of good press. It was her birthday. It happened the day she made her speech.”
Mr. Islam, of the Dhaka police, complained that the warnings came too late to prevent Mr. Tavella's shooting.
“They should have shared with us reliable information before the incident,” he said. “If they shared, maybe we might have avoided the killing.”
A spokeswoman for the United States Embassy did not respond directly to the Bangladeshi criticism, or criticize Bangladesh for mishandling the intelligence.
“Foreign governments have shared what information they have had with their Bangladeshi partners, but it is important to recognize terrorist attacks like what we have seen recently in Bangladesh are particularly difficult to counteract,” said the spokeswoman, Nancy VanHorn. “We stand ready to continue working with Bangladesh in the face of this challenge.”
Siegfried O. Wolf, a professor of political science at the South Asia Institute of the University of Heidelberg, said that foreign intelligence agencies did withhold sensitive information from Bangladesh, fearing that it could be misused. The country is in the grip of extreme political polarization, he said, and there is factionalism and rivalry among security agencies.
Moreover, mistrust of the United States runs deep in Bangladesh and carries a personal element for Ms. Hasina, going back to the longstanding suspicion that the Central Intelligence Agency had a hand in the 1975 assassination of her father, Sheikh Mujib. More recently, she was disappointed by Washington's cool response to her party's controversial 2014 election victory, and by the withdrawal of trade preferences for the garment industry.
Some countries have lent support to her skepticism. Alexander A. Nikolaev, the Russian ambassador to Dhaka, suggested that the United States and its allies were exaggerating the threat, remarking after the two shootings that “two drops of water doesn't mean rainfall.”
Over a month, the initial panic among expatriates has subsided, and foreigners have begun to reappear in Dhaka's supermarkets and five-star hotels. But they no longer walk on the streets, ride scooters or take bicycle rickshaws. The garment export industry, a major driver of the economy, has also been affected, with some buyers for Western clothing retailers canceling their annual visits, typically used to place orders for winter.
Diplomats here say the threat remains serious. One senior Western diplomat, speaking on the condition of anonymity for reasons of protocol, said the heightened threat was a “complete game changer” that would permanently affect security conditions for foreigners.
“This is not going to blow over,” the diplomat said. “The genie is not going back in the bottle. It's not going to un-change.”
For those Bangladeshis already apprehensive about militant activity, the contradictory messages have deepened their anxiety.
“The way this government is denying the existence of Islamic State, it is not acceptable at all,” said Mizanur Rahman Khan, a journalist at Prothom Alo, a prominent daily newspaper, who last month received a written threat on his mobile phone from “Islamic State Bangladesh” after he wrote an article about Uighur Islamic terror groups in China.
“Stop reporting against Islam and Muslims' interests, otherwise we're here to push you down to hell,” the message said.
Two weeks later, a stranger stopped him as he was riding a rickshaw and threatened him with a gun; he escaped on foot into a candy store. When he reported the episode to the police, he said, an official told him to stop riding rickshaws. Since then, he has stopped making television appearances, and, on the advice of his editor, varies the route he takes to work.
“We are in a very difficult position to understand the real danger,” he said. “We are not hearing anything from the government, or from the U.S. side, about what was the threat, what was the reaction of the government, why they are not cooperating.”
The writer is Bureau Chief of The New York Times South Asia.
Julfikar Ali Manik contributed reporting from Dhaka, and Eric Schmitt from Washington.
A version of this article appears in print on October 31, 2015, on page A6 of the New York edition of The New York Times with the headline: A Rift Emerges in Efforts to Quell Terrorism in South Asia.