Alexander Dighton, 28, has pleaded guilty to attacking police officers as he ran amok outside a police station in south Wales over a grudge with authority.
Alexander Dighton, from Llantrisant, Rhondda Cynon Taf, had represented himself and was charged with attempted murder and six other offences after three officers were injured at Talbot Green police station.
Police said there was a violent struggle after officers challenged a man allegedly damaging cars at about 19:00 GMT on 31 January.
Three officers were injured, with two taken to hospital and treated for their injuries.