EastEnders actress Linda Henry told a community warden "Do you know who I am? I'm Shirley", before hurling racial abuse at her outside a Jamie Oliver restaurant, a court heard.
The 55-year-old, who plays Danny Dyer's on-screen mother, Shirley Carter, in the BBC soap, is said to have launched into the tirade after being reprimanded for dropping a cigarette butt outside the premises.
The incident allegedly took place near Jamie's Italian in Greenwich, south east London, on September 14 last year.
Thea Viney, prosecuting, told Bexley Magistrates' Court that a black female warden and her black male colleague approached Linda and her partner after seeing them smoking in Nelson Road.
She added that when the Greenwich Town Council wardens challenged the actress, who has been charged under her married name Valiris, she told them they had no "photographic evidence".
Ms Viney said: "(She) told her that throwing litter was a zero-tolerance offence in Greenwich Borough and the Crown say that Ms Valiris responded by saying 'do you know who I am? I'm Shirley'."
The court heard that, having previously refused to hand over any personal details, Linda now gave the warden limited information, including what the litter officer suspected to be a false postcode.
The actress is then said to have told her alleged victim: "Who do you think you are? Go away, f*** off, n*****."
Linda denies one count of using threatening or abusive words that were likely to cause harassment, alarm or distress, and that the alleged offence was said to have been racially aggravated.
The actress, of Kelvington Road, south east London, appeared in court wearing a black suit and white shirt.
Supporting her in the public gallery was her former EastEnders co-star Cheryl Fergison, who played her on-screen best friend, Heather Trott, in the soap.
Linda, who has played feisty barmaid Shirley since 2006, is also known for her role as Yvonne Atkins in the ITV drama Bad Girls between 1999 and 2003.
Giving evidence, the warden, Iyabo Adetokunbo, said she approached the actress after she saw her drop a cigarette on the ground and asked for her details for a fixed penalty notice.
"She said 'Do you have photographic evidence?'" Ms Adetokunbo told the court.
"When I asked her again she said 'Do you know who I am?' I said 'I still need your details.'
"She said she's Shirley and 'Are you new?'"
After Linda provided her details, the warden suspected she had given a false address and told her that, if she had, that would be an additional offence.
Ms Adetokunbo said: "That was when she said 'f*** off, n*****'."
She added that the actress shouted the abuse "arrogantly" from about three or four metres away.
"She said it as if I'm nothing and then just walked away ... into the restaurant," she said.
The warden said she was "distraught" afterwards.
"I was upset," she told the court. "We have a job to do. I was doing my job.
"She littered. I approached her. She called me a n*****. That really, really upset me. I can't describe how I felt."
Under cross-examination from Sarah Elliot QC, defending, Ms Adetokunbo told the court that she occasionally watched EastEnders, but did not recognise Linda until she approached the actress.
She conceded that she was initially confused when the actress gave her name as "Linda", expecting her to have said the name of her character.
"In my mind I was thinking it (the name) was different from Shirley."
Ms Elliott asked the witness: "Did you think she actually was Shirley, do you think Shirley is a real person?"
Ms Adetokunbo replied: "She said to me, do you know who I am? I'm Shirley."
After the actress allegedly abused the warden, she allegedly went back into the restaurant and later pulled "mocking" faces at the two council staff, calling them the "cigarette police", the court heard.
Ms Ellis said: "I suggest you said to her 'I know who you are and I will get you'."
The witness heatedly replied: "Why do I want to get her? To me she is an individual who committed a littering offence. That is who she is to me.
"Greenwich Council is zero-tolerance on littering - she is not above the law."
She added that she got the impression that Linda thought she could get away with dropping the cigarette butt on account of her fame.
When it was put to her that the actress, who admits dropping the litter, did not racially abuse her, Ms Adetokunbo responded: "She did."
The court also heard from the warden's colleague Edward Mendy, who claims that immediately after the alleged incident, she turned to him and said: "Did you know she racially abused me?"
He told the court that because of the seriousness of the matter, he advised her to tell the police.
Describing Ms Adetokunbo's demeanour after the alleged abuse, Mr Mendy said: "She was very, very, very upset. She was very upset - shaking."
The court was read a transcript of the star's police interview.
In it, she told the officer that, when approached by Ms Adetokunbo, she said "What?", not knowing what the warden wanted.
Linda continued: "I said 'Well, if you know who I am, go away and leave me alone'."
Asked if she had said to the woman "Do you know who I am?", Linda told the interviewing officer: "I can swear to God, I would do a lie detector, I would do anything.
"I would never, ever, ever say that to a member of the public, or anybody."
The court heard that the actress took a sharp breath when it was put to her that the allegations were she had called the warden "n*****".
"I totally ... I might take her to court. That is absolutely disgusting.
"She told me she knew who I was anyway and that she would get me," Linda told the interviewing officer.
She added that it was "really difficult" doing what she does because someone is always "out to get out you when you've done nothing wrong".
Linda firmly denied racially abusing Ms Adetokunbo and told the officer: "Absolutely not. I would swear on my children's life, deathbed even.
"(I am) absolutely shocked that somebody could make up such an awful thing. I did not racially abuse that woman - it is not in my psyche."
Taking to the witness box to defend herself, Linda told the court she finds the word n***** "repulsive" and would never use the racist slur.
She said: "If I heard somebody else call somebody else that, I would be absolutely outraged and I would call the police immediately, (not) wait until the next day.
"I think it is repulsive."
Describing the incident, she said Ms Adetokunbo challenged her about putting the cigarette out on the ground outside the restaurant, and conceded that she had initially given a fake address in the confrontation.
"She made a comment about she knows who I am and she will get me in the end," Linda said.
The actress told the court that most of the time when she is approached by members of the public it is "lovely", but there is a small percentage who believe she is the "strong, feisty" character she plays in EastEnders and abuse her.
Linda told court that she lives in the multi-racial area of Peckham, is married to a Greek man, and has a "mixed-race daughter".
When it was put to her that she had lost her temper that day, she said: "No, I did not."
She told the court that if she had used "possibly the worst word in the English language" then she would have no career.
Linda's husband of 20 years, Stavros, who was by her side during the altercation with the council warden, told the court his wife is a "funny, loving" woman who is "full of life".
He added that he first thought Ms Adetokunbo was approaching his wife for an autograph or picture, as many people often do.
But when he noticed the tone of the conversation change he started to pay more attention, and claims he heard the Greenwich Council worker say to Linda, "I know who you are, and I'll get you".
When asked if he had ever known the actress to use racist language, he firmly replied "never".
The court also heard evidence from EastEnders' executive producer, Dominic Treadwell-Collins.
He said that, although he has a cold and the "biggest week" in the show coming up, he would not be giving evidence if it was not important.
He described Linda as a "low-maintenance" member of the crew, who "says it how she sees it".
Asked if he thought she would used racist terms such as n*****, he replied: "That is absolutely the last thing on earth I would expect Linda to say."
In a statement to the court, the actress's black co-star, Diane Parish, who plays Denise Fox in the soap, said she did not think the actress would use racist language such as that alleged.