A career burglar attacked an off-duty detective chief inspector with a crowbar after he caught him trying to break into his neighbour's home.
Andrew Moss was foiled when the officer was out running and spotted him on the doorstep of the house in Seacroft.
Leeds Crown Court heard the homeowners were away on holiday at the time of the incident and had previously had their home broken into.
The detective lived nearby and had been keeping an eye on the house at the time of the incident, March 12 this year.
Robert Galley, prosecuting, said the officer went into the garden and saw Moss wearing gloves with his hood pulled up.
Moss became aggressive when challenged by the officer and pulled out a crowbar.
The defendant told the officer: "You are going to get knocked out."
The officer put his hand up to defend himself but was struck on the upper arm with the weapon.
The two men struggled before dog walkers passing the house joined in and helped detain Moss.
Moss, of Boggart Hill Road, Seacroft, denied any intent to burgle the house and claimed he had been looking for scrap metal.
He pleaded guilty to attempted burglary, going equipped for theft and assault.
James Littlehales, mitigating, said Moss's partner was expecting a child and he committed the offence as he was desperate for money for his family.
He added that Moss had pleaded guilty to the offences at an early stage.
Moss was jailed for three years.
Judge Simon Batiste said: "You are a career burglar.
"Only an immediate custodial sentence can be justified."