If the remark was held to be racist then an apology at the earliest opportunity will be significant mitigation.
That depends on the nature of the apology.
"Sorry for the offense caused" is the form of words often used in forced apologies and is, in fact, an insincere non-apology for holding and expressing a held view.