There seemed to be little question that Edgar Morales was a man of ill repute back in the day. He was a member of the St. James Boys, a Mexican-American youth gang that ran roughshod over a stretch of the Bronx, and he was convicted for his role in a shooting at a church christening party that killed a 10-year-old girl.

But whether Mr. Morales was a terrorist, as the Bronx district attorney’s office had successfully asserted, was another matter — one that was the subject of a hearing on Tuesday by New York State’s highest court.

The seven judges of the Court of Appeals often seemed skeptical in asking the district attorney’s office to explain why it made sense to prosecute a street gang member in 2007 under the state’s terrorism statute. It was the first conviction under a charge that Albany lawmakers added to the state Penal Code shortly after the attacks of Sept. 11, 2001.

“How does this relate to something like 9/11?” asked Jonathan Lippman, chief judge of the State of New York.