A 21-year employee of the school system could lose his job after officials accused him of repeatedly leaving early – and stunned the worker with data it got by tracking his movements with a city-issued cellphone, The Post has learned.

In a precedent-setting case, administrative trial judge Tynia Richard recommended the firing of John Halpin, a veteran supervisor of carpenters, for cutting out before the end of his shift on as many as 83 occasions between March 2 and Aug. 9, 2006.

The evidence against Halpin, whose base pay is $300 a day, included time cards that suspiciously appeared stamped on the same machine, even though his duties placed him in different locations each day.

But there was a clincher: data gathered through the GPS system on Halpin’s cellphone, which he accepted in 2005 without being told it might be used to trace his every move.

On March 8, for example, supervisors determined that Halpin was last in Manhattan at 1:31 p.m. and was home in Levittown, L.I., at 2:40 p.m. On March 29, Halpin was found at home at 2:38 p.m.

The earliest he was caught in Levittown was 1:40 p.m. on June 22.

But his shift wasn’t supposed to end until 3:30 p.m.

Some workers refused the free-phone offer, saying they preferred to use their own cells.

Richard said the unsuspecting Halpin “admitted he took the phone because he liked the walkie-talkie and other functions it has.”

She dismissed concerns about whether the city had to warn Halpin in advance of the cellphone’s tracking abilities.

“The department [of Education] is not expected to notify its employees of all the methods it may possibly use to uncover their misconduct,” Richard decided.

“The undisputed intent of issuing the cellphone with GPS was for the department to be able to determine the whereabouts of its supervisors in the field.”

Rachel Minter, a lawyer who specializes in labor relations, said she knows of very few similar cases because the law hasn’t caught up to the technology.

“This is a very interesting case because it raises issues very much on the edge,” she said.

Halpin questioned the reliability of the data and argued that his privacy was invaded, since officials tracked him when he wasn’t at work.

In fact, the data found Halpin on numerous occasions turned up early for his job, sometimes at 6 a.m. His shift started at 8 a.m.

Despite the extra hours Halpin put in without pay, Richard ruled that it didn’t mitigate his early departures and recommended he be fired.

Halpin has been removed from his duties and is awaiting word on whether Schools Chancellor Joel Klein will follow the administrative judge’s recommendation.

david.seifman@nypost.com