Former England footballer Trevor Sinclair, 44, has been sentenced at Blackpool Magistrates' Court to 150 hours community service for a racially-aggravated public order offence and given a 20-month drink drive ban.
Sinclair pleaded guilty to drink-driving and a racially aggravated public order offence against a police officer in the resort on November 12 last year.
Sinclair racially abused a police officer after being arrested for drink-driving while twice the limit. The TV pundit asked the officer if he was being arrested due to him being black, accusing the officer of racism. The former QPR winger proceeded to then urinate in the back of the police car, a court heard.
The 44-year-old, who is a patron the charity Kick It Out, was then taken to cells at Blackpool Police Station, where he continued being racist.
Sinclair, of Victory Boulevard, Lytham, Lancashire, pleaded guilty on Tuesday to drink driving and a racially aggravated public order offence on November 12 last year.
Sinclair legal representative, Nick Freeman, said the "catalyst" for the former footballer's behaviour was being subjected to racism, while out having a meal with his family hours earlier.
Mr Freeman alleged that a woman came up to the father of four, patting him on the head and calling him a "little chocolate man".
Following Sinclair's guilty pleas the prosecution dropped other charges including assault on a police officer, failing to provide a specimen and criminal damage.
The court heard that police were called to Sinclair's home at 8.45pm on November 12 last year, after they were alerted to an incident, but were then told Sinclair has left in his car and may have been drinking.
Officers searched for Sinclair and found his Tesla car stopped in the middle of Clifton Drive, Blackpool, where it had collided with a woman exiting a taxi.
In a statement read to the court, Pc Gareth Evans said: "I asked Mr Sinclair what had happened. It appeared to me he was drunk, unsteady on his feet and his eyes were glazed."
Sinclair's roadside breath test found him to be twice the drink-drive limit, giving a reading of 72 micrograms of alcohol per 100 millilitres of breath, with the limit being 35mg. At this point the former footballer was cautioned and arrested, with the officer requesting a secure van to attend.
While waiting for the van, Sinclair's behaviour changed, the court heard.
Pc Evans' statement continued: "Before his arrest he was very calm, polite and courteous.
"He started asking if it was because he was black. Black people are under-represented in the police. He started getting more confrontational, he was getting more aggressive. I did not like the direction the conversation was going in - he was accusing me of being racist.
"He began to become more agitated and aggresive."
Sinclair was searched by officers, who found that he had wet himself in the back of the police car.
The police van arrived to take Sinclair to the station, but when he was put into the back, he called the officer a "white..." followed by a swear word as the doors slammed.
Sinclair continued to make racist comments while in the van and was "obnoxious, aggressive and racist while being booked in".
Pc Evans' statement concluded: "Sinclair's behaviour following his arrest was awful. I'm not a racist. His behaviour was extremely racist."
Sinclair enjoyed a lengthy career playing for the likes of Manchester City and West Ham United, as well as earning 12 caps for England, including representing his country at the 2002 World Cup.
Since retiring in 2008 the 44-year-old has worked as a pundit, predominantly for the BBC.
Sinclair is expected to be sentenced later on Tuesday.