LONDON — The police in Northern Ireland said on Saturday that they had arrested two men under the terrorism act in connection with the killing of Lyra McKee, a journalist who was covering a night of violent unrest in Londonderry.

The men, ages 18 and 19, were taken to a police station in Belfast, the capital, which handles serious investigations, to be questioned in the killing of Ms. McKee on Thursday in the Creggan area of Londonderry, the Derry City and Strabane District Police said in a statement on Twitter. Londonderry is known to many of its residents, especially those who are Roman Catholic, as Derry.

The police said on Friday that they were attributing the killing on Thursday night to the New Irish Republican Army, a militant splinter group.

The violence that night came on the 21st anniversary of the Good Friday agreement, the 1998 accord that largely brought an end to decades of conflict in the region between republicans or nationalists, largely Catholic, who believe Northern Ireland should be part of a united Ireland, and unionists, largely Protestant, who want it to remain British.

According to the Committee to Protect Journalists, Ms. McKee, 29, was the first journalist to be killed in Northern Ireland since 2001, when loyalists — unionist extremists — shot dead Martin O’Hagan, a reporter investigating paramilitaries and drug gangs for a Dublin-based newspaper.

In the search for information about Ms. McKee’s killing, the police released CCTV footage showing her standing in the crowd in Creggan, a heavily Catholic area of Londonderry, on the night she was killed. The video also shows a masked figure leaning in from behind a street corner.