The 31-year-old Chelsea defender allegedly called Ferdinand, who plays for Queens Park Rangers, a "f****** black c***".
Terry is accused of a racially aggravated public order offence during a Premier League match on October 23 last year, which was broadcast to millions of people.
Appearing at Westminster Magistrates' Court, Terry sat in the dock wearing a light grey suit, white shirt and pink tie. The court heard that Terry told Ferdinand to "f*** off" and also called him a "f****** k***head" as the pair exchanged insults.
Opening the prosecution, Duncan Penny said: "The Crown alleges that the words he used demonstrated hostility based on Mr Ferdinand's membership or presumed membership of a racial group."
The court heard that Terry maintains he was only sarcastically repeating words that Ferdinand wrongly thought he had used.
Mr Penny said: "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."
He went on: "The Crown's case is that the words were abusive and insulting in a straightforward sense and that the term 'f****** black c***' was uttered as an abusive insult demonstrating hostility based on Mr Ferdinand's membership of a racial group.
"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 out of the dock into the well of the court to view footage of the alleged insult.
Source: PA
Source: PA