Josh Meekings, 23, denies causing offences aggravated by sexual orientation prejudice in an Inverness street on 20 December last year.
He was arrested by police officers who heard the Inverness Caledonian Thistle defender's remark to an unidentified man, Inverness Sheriff Court heard.
Sentence was deferred on Meekings for six months for good behaviour.
The incident in Inverness city centre came after Inverness drew 2-2 with Dundee United.
Defence lawyer John MacColl told the court that his client had offered a guilty plea admitting to a confrontation with police.
The court heard that officers saw Meekings "gesticulating aggressively" towards a man and tried to move the player away. The officers then heard footballer's offensive remark.
Mr McColl said of his client's behaviour: "It was conduct in the face of deliberate baiting and vile racist abuse directed at him. His was a spontaneous remark said in the heat of the moment."
Sheriff Gordon Fleetwood told Meekings: "If there is no repeat of this nonsense, then it is open to the court to grant you an absolute discharge which will mean you will not have a criminal record."
If Meekings has not committed any further offences, he was told he did not have to re-appear in court personally on 4 May next year.
A footballer shouted homophobic abuse at a man who had made a racist comment to him, a court has heard.