Pc Alex MacFarlane, 53, was recorded on a mobile phone by Mauro Demetrio allegedly telling him: "The problem with you is you will always be a n*****, yeah?
Jurors heard the officer's foul mouthed tirade was intended to make Mr Demetrio feel "inferior to the officer because of the colour of his skin".
The comments were recorded by Mr Demetrio in the back of a police van at the tail end of the London riots on August 11 last year.
Earlier the suspect had been pulled over and arrested on suspicion of driving under the influence of drink or drugs, Southwark Crown Court heard.
Prosecutor Duncan Atkinson said during the journey to Forest Gate police station in east London, Mr Demetrio had been 'abusive and shouting' after an alleged assault on him by another officer.
Mr Aktinson said: "Whatever the circumstances it is clear that the defendant was on duty and under an obligation to remain calm and professional.
"It is clear, however, that just as Mr Demetrio was abusive to officers the defendant in his turn was abusive to Mr Demetrio.
"It is alleged that that abuse was racially motivated and was targeted and was intentional and it is that that this case is about.
"Such words were designed to cause and indeed did cause distress an insult because they were designed to suggest to Mr Demetrio that he was inferior to the officer because of the colour of his skin."
He told the jury that the officer's outburst was recorded by Mr Demetrio on his mobile phone so there could be "no dispute" that MacFarlane uttered the comments.
He said: "The prosecution say that the words recorded sought to put Mr Demetrio in his place by demeaning him and distressing him."
MacFarlane, whose address is given as c/o Forest Gate police station, denies causing racially aggravated intentional harassment, alarm or distress.
MacFarlane, like all other Met officers, had attended a two diversity training course intended to "help officers understand what was and what was not acceptable conduct and language".
The barrister added: "The training was that 'N*****' was a word that should never be used by a serving police officer regardless of the circumstance.
"It follows that in a professional circumstance the defendant was well aware that this was a word that could be deeply hurtful and demeaning and therefore should not be used."
The court heard 21-year-old Mr Demetrio was stopped by officers, including MacFarlane, at 5.55pm in Routh Street, near Beckton, east while driving a black Citroen.
Mr Atkinson said: "It was the driver of the police van that though Mr Demetrio was not driving normally and the officer believed he could smell cannabis.
"The officer said he intended to search him.
"He said that because Mr Demetrio was moving about he handcuffed him and took him to the police van".
Mr Atkinson said that a radio check carried out uncovered that Mr Demetrio was wanted for failing to appear at Stratford Magistrates' Court two days earlier and in relation to an allegation of supplying, use, or manufacturing of drugs.
He said Mr Demetrio alleged that while in the van he was strangled by an officer and had his face pushed up against a window.
The court heard medical examiners later found bruising to his right ear and neck.
Mr Atkinson said: "During the journey from Routh Street to Forest Gate Mr Demetrio recorded on his phone an exchange he had with an officer in relation to what had happened."
The court heard the officer accused of assaulting Mr Demetrio had called him a 'scumbag', a 'p****', and 'f*****g ugly c**t', and that Mr Demetrio had retaliated by calling the officer a 'c***'.
The barrister said: "It was following that exchange that Mr Demetrio first spoke to Mr MacFarlane.
"He says that the officer was also abusive towards him saying that he was going to die within five years.
"He also made comments about Mr Demetrio's mother saying that he had had sexual experiences with her".
Mr Demetrio was heard to have responded by saying MacFarlane was an "old man" who was "going to die in a year from old age".
It was after this exchange that MacFarlane was recorded as saying "The problem with you is you will always be a n*****, yeah?"
Mr Atkinson said: "Mr Demetrio was shocked at what the defendant had said to him, which he considered to be a racist comment."
MacFarlane went on to say: "You will always have black skin colour" and "Do not hide behind your colour, yeah" and "Be proud of who you are".
He said that those comments had come after a fellow officer could be heard saying "Calm down" after the initial comments.
Mr Atkinson said: "While the officers had been laughing at other abuse they did not laugh at those comments.
"The defendant in interview relied on the second half [of the exchange] to support is explanation that he was trying to explain that the officers were not treating Mr Demetrio as they had because he was black and telling him to be proud of who he was."
Mr Demetrio told the court he had been left feeling "low and sad" by MacFarlane's comment.
He said: "It made me just feel like s*** really, to be honest.
"I just felt like at that point that it can't get any worse than that.
"I really felt violated. I can't even explain the right word to use to describe the way I felt.
"I just felt really low and sad and it added to my anger which I had already."
The trial continues