The row began after Terry failed to return the ball to QPR during the last few minutes of a tense game at the latter team's ground in West London. Annoyed, Ferdinand began to make lewd 'fist-pumping' hand gestures at 31-year-old Terry.
His opponent understood the gesture to "refer to the well-publicised allegation" that he had had "an extra-marital affair with a team-mate's wife", prosecutor Duncan Penny said.
In response, Terry began shouting at Ferdinand, using a string of swear words, Mr Penny said. The prosecutor added: "The words were abusive and insulting in a straightforward sense".
They were "uttered as an abusive insult demonstrating hostility based on Mr Ferdinand's membership of a racial group".
Ferdinand said he had not heard the word 'black' - only swear words that he reacted to by raising the issue of Terry's affair.
After the game, Terry called Ferdinand to his team's changing room, where he is alleged to have said: "It's handbags innit - it's what happens on the pitch."
The pair shook hands but - after watching footage of the incident with his then girlfriend - Ferdinand believed that Terry had made a racist comment and became 'livid' over what had happened.
When he was questioned by police over the incident, Terry admitted using a racist jibe but claimed he had said it ironically, believing Ferdinand had just accused him of making that same remark.
'Whilst footballers are used to industrial language, saying racist terms is completely unacceptable whatever the situation,' he said. 'I was completely taken aback by this remark as I have never been accused of something like that.'
The England defender added that he had not been offended by the taunts about his alleged affair, because "it's not the first time I've heard it, so it's with a pinch of salt a little bit now".
Terry, a married father of two who earns £160,000 ($NZ312,000) a week, denies a racially aggravated public order offence, which carries a maximum fine of £2,500 ($NZ4,880).
More than 100 photographers and cameramen lined the entrance to the West London Court awaiting his arrival.
Wearing a tailored grey suit and pink tie, Terry was bundled by his security team through a side door to avoid the huge crowd of press and public at the front of the court.
At the start of the hearing, the England player asked if he could sit next to his barrister rather than in the dock. Chief magistrate Howard Riddle rejected his request although he briefly permitted him to leave the dock so he could watch as footage of the incident was played to the court.
Giving evidence yesterday, Ferdinand said: "When someone brings your colour into it, it takes it to another level and it's very hurtful."
But he said he had initially avoided giving a statement to police because he wanted the incident to be dealt with by officials at the Football Association.
"This is a footballing issue that happened on the football pitch where we work," he said. He denied a suggestion that he went to police only when persuaded to by his publicist Justin Rigby, who also works for Rio.
Ferdinand said: "No, I made up my own mind, I wanted to do it."
The decision to investigate the former England captain was taken when police received a complaint from a member of the public after the Premier League match.
A lip reader gave evidence saying she had studied the footage and confirmed the use of the word 'black'.
Terry, whose Chelsea team won the Champions League and the FA Cup in May, was part of the England side that reached the quarter finals of Euro 2012 last month. He was stripped of the national team's captaincy for a second time this February after the date for his race row trial was set.
Ferdinand has played for West Ham, Sunderland and QPR. His brother was John Terry's former defensive partner in the national side.
Doreen Lawrence, mother of murdered black teenager Stephen Lawrence, attended yesterday's hearing and sat in the public gallery.
The trial, which is expected to last five days, continues.
- DAILY MAIL