A Massachusetts police officer accused of raping a 13-year-old boy he had met on a dating app was ordered held without bail Tuesday, authorities said.

Lawrence Officer Carlos Vieira, 49, was ordered held pending a dangerousness hearing scheduled for Friday after he was arraigned on two counts of aggravated rape of a child and indecent assault and battery on a child under 14, according to the Essex District Attorney’s Office.

Essex Assistant District Attorney Kim Faitella told Judge Lynn Rooney that prosecutors were contacted by the teen’s mother Jan. 29 after learning that her son had sexual contact with a police officer.

“The investigation revealed that the boy and the defendant allegedly were in contact through the social media app GRINDR,” according to a news release by the district attorney’s office.

The alleged rape took place after Vieira met the teen at Mt. Vernon Park in Lawrence before engaging in sexual acts on one occasion last summer. The boy then recognized Vieira as the man he met at the park when he spotted the officer on crowd control duty following a gas explosion in September, prosecutors said.

Vieira, who joined the force in 1999, was placed on administrative leave following his arrest, the Boston Globe reports.

Vieira’s attorney, Gil Nason, said his client was mistaken for another man.

“The big question here is identification as to whether or not they even picked the right person,” Nason told WBZ-TV, adding that a photo array displayed by investigators did not positively identify Vieira. “That’s an accusation. That’s sometimes all it takes. As far as we know, there is no DNA, there’s no forensics in this case. It’s just an ID of somebody saying something. And that’s why we’re here.”

Lawrence Mayor Dan Rivera said he was “angry, sickened, dismayed [and] saddened” by the allegations.

“We have fired and forced out many officers who did not meet and could not stand up to the code of conduct and the high level of professionalism that my office, the chief of police and the men and women and leadership of the police unions have worked to establish,” Rivera told WCVB. “If [the allegations are] found to be true, we will move swiftly to remove the officer involved. This is a travesty.”