BELFAST — A bright young journalist whose work focused on the legacy of violence in the Northern Ireland conflict, known as “the Troubles,” was killed Thursday night during riots in the border city of Londonderry.

Police had been carrying out raids against suspected militant Irish nationalists, and shots fired during the ensuing clashes struck the writer Lyra McKee, 29, of Belfast, authorities said.

It was a night of random gunfire and petrol bombs — like the nights from the old days, an echo to the years when Ireland was tearing itself apart.

But this is 2019, and it was broadcast on social media.

McKee’s last tweet on Thursday night showed a photograph of the rioting, with white police vans and black smoke rising in the distance.

“Derry tonight,” she wrote. “Absolute madness.”

Police opened a murder investigation and said they considered the shooting “a terrorist act.”

McKee was the first working journalist to be killed in the United Kingdom since 2001.

While the violence of the Northern Ireland conflict — between pro-British Protestant unionists and Irish Catholic republicans — mostly ended some 20 years ago, with the signing of the 1998 Good Friday Agreement, small numbers of opponents known as dissident republicans remain.

Many of these dissidents consider Northern Ireland, a part of the United Kingdom, as “occupied territory” and the Police Service of Northern Ireland as an illegitimate force. They reject the peace accord and continue to press — politically, but also with guns and bombs — for a unified Ireland.

The killing of a journalist during a police raid against republican extremists on the eve of Easter celebration shows how volatile the Irish borderlands still can be.

The shooting occurred as police moved into the heavily Irish nationalist neighborhood of Creggan in Londonderry, also known as Derry, on Thursday night. 

“We believed that violent dissident republicans were planning attacks in this city, and we were looking for munitions and firearms that we believe may be about to be used across the Easter weekend,” Mark Hamilton, assistant chief constable of the Police Service of Northern Ireland, told journalists Friday.

Molotov cocktails were thrown and two cars set on fire in Northern Ireland late on April 18 after journalist Lyra McKee was kiled during a police raid. (Reuters)

Dissident republicans claimed responsibility for a car bomb that exploded in Londonderry’s city center in January. Police also blame the group for a string of murders and pipe bomb attacks. Members of the so-called New IRA are said by police to mingle republican politics with crimes such as drug dealing, prostitution and robbery — making them a kind of hybrid gang-militia.

As police moved into the Creggan neighborhood on Thursday, their vans were struck by gasoline bombs, bricks and fireworks.

“At 11 o’clock last night, a gunman appeared and fired a number of shots towards the police, and a young woman, Lyra McKee, 29 years old, was wounded” and later died, Hamilton said.

“We believe this to be a terrorist act. We believe this has been carried out by violent dissident republicans,” Hamilton said. He charged that New IRA members were most likely behind the killing.

Police released CCTV footage of the riot and encouraged witnesses to come forward.

“People saw the gunman and people saw those who goaded young people out onto the streets, people know who they are,” said Detective Superintendent Jason Murphy, who is leading the investigation. “The answers to what happened last night lie within the community.”

A far-left, fringe republican political group called Saoradh issued a statement after the shooting, accusing the police of “waging a campaign of oppression.”

“The inevitable reaction to such an incursion was resistance from the youth of Creggan,” Saoradh said in a statement. “The blame for last night lies squarely at the feet of the British Crown Forces, who sought to grab headlines and engineered confrontation with the community,” it said.

“During this attack on the community, a Republican Volunteer attempted to defend people from the PSNI/RUC,” the statement continued, referring to the Police Service of Northern Ireland and its predecessor, the Royal Ulster Constabulary. “Tragically a young journalist covering the events, Lyra McKee, was killed accidentally while standing behind armed Crown Force personnel and armored vehicles. This outcome is heartbreaking and we extend our sincerest sympathy to the family, friends and loved ones of the deceased.”

Politicians across the spectrum condemned the shooting.

Sinn Fein deputy leader Michelle O’Neill said: “Those people who carried out this attack have no place in society. Those people who carried out this attack do not have any support. Those people who carried out this attack have attacked all of us. They have attacked the community, attacked the people of Derry. They have attacked the peace process, and they have attacked the Good Friday Agreement.”

She added, “They should disband. They should desist.” 

Arlene Foster, leader of the pro-British Democratic Unionist Party, said: “It is absolutely heartbreaking. . . . Violence, criminality and terrorism was always wrong and is still wrong today in 2019. We condemn it wholeheartedly.” 

Foster made the comments during a symbolically important first visit to the nationalist neighborhood, where she was warmly welcomed by a crowd of hundreds who gathered for a vigil.

McKee wrote a book about the “cold case” IRA killing of Robert Bradford, a politician from south Belfast, and was working on another about young people who disappeared during the Troubles.

She first gained attention for a blog post and subsequent short film, “Letter to my 14-year-old self,” describing her experience coming out as gay to her friends, family and especially her mother.

“Instead of getting mad, she will reply, ‘Thank God you’re not pregnant,’ ” McKee assured her younger self. “You will crawl in her lap, sobbing, as she holds you and tells you that you are her little girl, and how could you ever think that anything would make her love you any less. You will feel like a prisoner who has been given their freedom.”

McKee was named Sky News’s young journalist of the year in 2006, and Forbes magazine identified her as one of their 30 under 30 in media in Europe in 2016.

John O’Doherty, director of the Rainbow Project, an advocacy group for LGBT people in Northern Ireland, hailed McKee as “a hero” who used “her own coming-out story to empower others to live as their most authentic selves.”

“To lose someone like Lyra at any age is a difficult thing to accept, but to lose her at 29 in such despicable and avoidable circumstances is devastating,” he said.

McKee’s partner, Sara Canning, said during the vigil on Friday afternoon that she had lost “the love of my life and the woman I was planning to grow old with.”

“Our hopes and dreams and all of her amazing potential was snuffed out by a single barbaric act,” Canning said. “This cannot stand.”

There has been concern that Brexit could exacerbate conflict along the Irish border. One of the points of contention in Britain’s exit plan is how to maintain the openness and invisibility of the border once Northern Ireland has left the European Union. The Republic of Ireland will remain an E.U. member.

House Speaker Nancy Pelosi (D-Calif.) was in Londonderry earlier this week, stressing her message to all sides that the turmoil of Brexit should never undermine the protections offered by the U.S.-brokered Good Friday Agreement.

Booth reported from London.