The would-be ham bandit, identified only as J.A.M.C., broke a car window in the western Spanish city of Badajoz in 2011.
He then stole a whole cured ham worth €640, according to Spanish daily Hoy.
Two civil guard police officers later stopped the man and asked for identification.
He told them that they had "no right to take him" and fought with the officers before being arrested.
One of the officers received injuries which left him unfit for duty for 30 days and the other required treatment for trauma and 90 days of rehabilitation.
The judge ordered the man to pay €760 costs to the owner of the ham plus €1,800 and €5,400 compensation to the two injured officers.