NEW YORK - A teen suspect's snap decision to secretly record his interrogation with an MP3 player has resulted in a perjury case against a veteran detective and a plea deal for himself, authorities said yesterday.

Unaware of the recording, Detective Christopher Perino insisted under oath at a trial in April that suspect Erik Crespo "wasn't questioned" about a shooting in the Bronx, a criminal complaint said. But the defense confronted the detective with a transcript it said proved he had spent more than an hour unsuccessfully trying to persuade Crespo to confess - at times with vulgar tactics.

Perino, 42, was arraigned yesterday on 12 counts of first-degree perjury and faces up to seven years on each count, prosecutors said. He was released on $15,000 bail.

Perino arrested Crespo, then 17, on New Year's Eve 2005 while investigating the shooting of a man in an elevator.

Defense attorney Mark DeMarco said that after his client was taken into the interrogation room of the 44th Precinct stationhouse, he stealthily pressed the record button on his MP3 player, a Christmas gift.

After Crespo was charged with attempted murder, his family surprised DeMarco by playing him the recording.

Once the transcript was revealed at Crespo's trial, prosecutors asked for a recess, DeMarco said. The detective was pulled from the witness stand and was advised to get a lawyer.

Prosecutors returned to offer Crespo - who had turned down a deal for a 15-year prison term and faced up to 25 years if convicted - seven years if he pleaded guilty to a weapons charge.

He accepted. *