A burglar stole a camera which seconds before recorded him entering a dwelling in Ballymena.
The camera was movement-activated and it sent images to the householder who was out.
The pictures showed Shaun William Leitch (32), of Ballyclug Mews, Ballymena, struck at a neighbouring property at 8.07am on April 26 this year.
As well as the camera an X-Box was stolen.
When arrested Leitch spat on the back of a custody detention officer at a police station.
Leitch appeared at Ballymena Magistrates Court via video link from Maghaberry Prison on Thursday and was given a four months jail term on charges of burglary and assault.
The court heard he entered the property by removing a board.
A defence lawyer claimed the door was not property secured.
The barrister alleged the background to the offence had been a falling out between another person and the occupant of the burgled property.
District Judge Nigel Broderick told the defendant domestic burglaries “are a serious matter” but that thankfully motion-sensor CCTV had been set up and that led to Leitch’s detection.
The judge said the incident happened at a time when Leitch had been on bail for other matters.
Judge Broderick ordered that the defendant, who had 44 previous convictions, should start the four months sentence after he serves a current period of imprisonment.