The Blues captain is in court to face a racially aggravated public order charge relating to the accusations made following a Premier League match last October
The court heard that the pair traded insults during the match and that Terry used a racist obscenity against Ferdinand in response to taunts about his alleged affair with a team-mate's ex-partner.
The court was also told that the Chelsea captain insists he was only sarcastically repeating words that Ferdinand wrongly thought he had used, during the match.
The prosecution opened their case by saying: "The Crown's case is that the words were abusive and insulting in a straightforward sense.
"They were uttered by the defendant in response to goading by Mr Ferdinand on the issue of his extra-marital affair, rather than by way of exaggerated and instant querying of a perceived false allegation.
"The Crown alleges that the defendant, most probably in response to physical gestures being made by Mr Ferdinand which the defendant understood to refer to the well-publicised allegation of an extra-marital affair with a team-mate's wife, shouted at Mr Ferdinand.
"They were uttered by the defendant in response to goading by Mr Ferdinand on the issue of his extra-marital affair, rather than by way of exaggerated and instant querying of a perceived false allegation."
Terry was allowed to view footage of the alleged incident and footage, including previously unbroadcast pictures, which were also shown to the court.
Meanwhile, the court was also told that Chelsea team-mates Ashley Cole and John Obi Mikel were in the vicinity of the alleged incident, but will not be called up as witnesses for the prosecution.
After the incident had taken place Terry gave a statement to the Football Association saying the taunts about his alleged extra-marital affair did not bother him as: "it's not the first time I've heard it, so it's with a pinch of salt a little bit now".
He also said that: “We're still having a, sort of, ding-dong, if you like” but added that “I take quite a strong offence” at the allegation of racial abuse.
In a statement to police in November, Terry also said: "Whilst footballers are used to industrial language, using racist terms is completely unacceptable whatever [the] situation.
"I was completely taken aback by this remark as I have never been accused of something like that and I did not take his remark lightly at all, and took strong offence to his suggestion."
If convicted, Terry faces a maximum penalty of a £2,500 fine for an offence that has already seen him lose the England armband, an episode that directly led to the resignation of Fabio Capello.