LONDON — Police in Northern Ireland arrested two teenagers Saturday in connection with the fatal shooting of a young journalist during rioting in the city of Londonderry and warned of a “new breed” of terrorists threatening the peace.

The men, aged 18 and 19, were detained under anti-terrorism legislation and taken to Belfast for questioning, the Police Service of Northern Ireland said. The men have not been identified or charged.

Authorities believe one man pulled the trigger during the chaotic rioting that began Thursday night but had organizational support.

Lyra McKee, 29, a rising star of investigative journalism, was shot and killed, police say probably by a stray bullet aimed at police, during the rioting. Police said the New IRA dissident group was most likely responsible and called it a “terrorist act.”

The use of a firearm apparently aimed at police marks a dangerous escalation in sporadic violence that continues to plague Northern Ireland 21 years after the Good Friday peace agreement was signed. The New IRA group rejects the peace agreement.

Chief detective Jason Murphy warned Saturday that the situation on the ground has become more dangerous, even though community attitudes have changed since the peace agreement and the use of violence is viewed as abhorrent by the vast majority.

“What we are seeing is a new breed of terrorist coming through the ranks and that for me is a very worrying situation,” he said.

The riot followed a pattern familiar to those who lived through the worst years of violence in Northern Ireland. Police arrived in the city’s Creggan neighborhood to search for weapons and dissidents. They were barraged with gasoline bombs and other flying objects, then someone wearing a black mask appeared, fired some shots and fled.

No police were struck by the bullets, but McKee — who had been trying to film the riot on her phone — was hit. The journalist was rushed to a nearby hospital in a police car but still died.

Police on Friday night released closed-circuit TV footage showing the man suspected of firing the shots that killed McKee and appealed for help from the public in identifying him.

The killing was condemned by all the major political parties as well as the prime ministers of Britain and Ireland.

The European Union’s chief Brexit negotiator, Michel Barnier, said the killing was “a reminder of how fragile peace still is in Northern Ireland” and called for work to preserve the Good Friday peace agreement.

Some politicians believe uncertainty over Britain’s impending departure from the EU and the possible re-introduction of a “hard border” between Northern Ireland and the Republic of Ireland are stoking tensions in the region.

The victim was mourned by friends and the wider community. She rose to prominence in 2014 with a moving blog post — “Letter to my 14 year old self” — describing the struggle of growing up gay in Belfast, the capital of Northern Ireland. She also had recently signed a contract to write two books.

Shortly before her death, McKee tweeted a photo of the rioting with the words: “Derry tonight. Absolute madness.”

Her partner, Sara Canning, told a vigil Friday that McKee’s amazing potential had been snuffed out. Canning said the senseless murder “has left me without the love of my life, the woman I was planning to grow old with.”

Catholic priest Joseph Gormley, who administered the last rites to McKee, told the BBC that the rioting was “clearly orchestrated” by a “small group of people who want to play political games with our lives.”

He said he and other community leaders had tried to talk to the dissidents without success.

The New IRA is a small group that rejects the 1998 Good Friday agreement that marked the Irish Republican Army’s embrace of a political solution to the long-running violence known as “The Troubles” that had claimed more than 3,700 lives.

The group is also blamed for a Londonderry car bombing in January and has been linked to several other killings in the past decade.

Your support is crucial…

With an uncertain future and a new administration casting doubt on press freedoms, the danger is clear: The truth is at risk.

Now is the time to give. Your tax-deductible support allows us to dig deeper, delivering fearless investigative reporting and analysis that exposes what’s really happening — without compromise.

During this holiday season, stand with our courageous journalists. Donate today to protect a free press, uphold democracy and ensure the stories that matter are told.

SUPPORT TRUTHDIG