FBI Director James B. Comey said Thursday that the bureau is dispatching several dozen agents to Russia to help tighten security at the Winter Olympics.

The FBI is working with Russian intelligence services, Comey said. About two dozen agents and other personnel are being sent to Moscow, while more than a dozen others will be assigned to Sochi, the host city of the Games.

“Securing any Olympics is an enormous task,” Comey said. “I think it’s particularly challenging in Sochi because of its proximity to areas of unrest and sources of a terrorist threat.”

The threat of violence at the Games has been a persistent concern of security officials. Russia has been engaged in a longtime struggle with extremists, many of whom have vowed to target the Olympics, which open Feb. 7.

Two bombings in the city of Volgograd killed 34 people and injured dozens late last month. On Wednesday, Russian security forces found six bodies in an area north of the Caucasus Mountains region, according to the Associated Press. Explosive devices had placed near some of them.

In a wide-ranging interview with reporters at FBI headquarters, Comey said the bureau remains concerned about security at large venues and events generally. Law enforcement officials across the United States, he said, are refocusing their efforts on securing shopping malls after gunmen attacked Nairobi’s Westgate mall in September, killing more than 70 people.

U.S. intelligence indicates that home-grown terrorists continue to be interested in striking “soft targets,” Comey said.

“We are taking a lot of steps with the Department of Homeland Security, state and local law enforcement, and the retail industry to train, to anticipate, to drill,” Comey said. “It was going on before Westgate, and that effort was given renewed energy by the Westgate tragedy.”

During his first three months on the job, Comey has spent much of his time traveling to meet with FBI officials overseas. A growing concern they share is the threat that extremists who have joined the fight in Syria will return to their home countries, including the United States, to carry out terrorist attacks.

“It is one of my greatest worries in the counter­terrorism area,” Comey said. “The conflict in Syria has attracted so many people from so many places of so many motivations, including Americans, that it is an enormous challenge for all intelligence services, including the FBI, to identify the ones of bad intent, to figure out where they’re going, why they’re going and keep track of them.”

He added: “As long as people are flowing in, learning how to kill other people and meeting really bad people, it’s going to be a big worry.”

Comey defended the FBI’s controversial use of “national security letters,” a form of administrative subpoena that the bureau uses to obtain business records from companies and other institutions without a court warrant. The FBI issues more than 20,000 NSLs a year for phone subscriber information and telephone toll records, as well as banking and credit card records.

A White House panel recommended last month that Congress amend the law so that the letters can be issued only after a judge has found that the government has reasonable grounds for believing that the information is relevant to a terrorism or intelligence investigation.

Comey said he disagrees with that recommendation because the NSLs are a critical investigative tool for fighting terrorism. A change in procedures would “introduce a delay” in terrorism investigations and require agents to take weeks to do something that now takes hours or days, he said.