The families of two boys charged in connection with the murder of schoolboy Michael McIlveen have been threatened, a court in County Londonderry was told.
Michael McIlveen died after being attacked in Ballymena
A detective told Coleraine Magistrates Court that tensions were high in Ballymena with fears of reprisals.
He was opposing bail for a 15-year-old boy charged with the Ballymena boy's murder last Sunday and a 16-year-old youth charged with causing affray.
Both accused were remanded in custody on Monday.
Five teenagers are already in custody charged with the murder of the 15-year-old St Patrick's College pupil in Ballymena last Sunday.
The teenager died last Monday, a day after being attacked by a gang at Garfield Place, Ballymena.
A detective told the court on Monday that when charged, the boys had replied "no" or "not guilty".
The youths, who cannot be named for legal reasons, spoke only to confirm their identities.
The detective said the families of both the accused had already been threatened.
He added that tensions were very high in the town, and that police intelligence indicated fears of street disorder and possible republican reprisals.
It would be almost impossible to guarantee their safety if they were released from custody, he said.
Magistrate Richard Rolston said tensions were clearly so high in the town that bail would not be granted.
The two youths are due to appear by video link with five other co-accused at Ballymena Magistrates Court on 8 June.
The police said a number of witnesses have still to come forward.
A book of condolence for the McIlveen family has been opened by Ballymena Council.