Eric Greene, 58, visited the Lanark branch of a British optical retail chain when he told Sarah Kerr that he would "rather be seen by a white person", a court has heard.
Mr Greene was branded a bigot by Sheriff Nikola Stewart who told him, "Charlottesville is what happens if you don't take this kind of thing seriously," the Scotsman reported.
Mr Greene, of Lanarkshire, had gone to the store when he was asked by the employee to join her at her desk.
The appointment was two days after the Manchester Arena bombing of May 22 that saw 22 people killed at an Ariana Grande concert.
Trainee optician Ms Kerr noticed Mr Greene looked hesitant but was left stunned when he told her, "I don't mean to sound impersonal but I'd rather be seen by a white person."
Mr Greene pulled down his t-shirt to show he was wearing a Star of David necklace and added, "I'm sorry but Manchester was the last straw for me."
Horrified staff overheard the outburst and asked him to leave before police were called and Mr Greene was arrested.
On being interviewed, he repeated that Manchester was the last straw for him and told police he had family living there. Mr Greene has appeared at Lanark Sheriff Court and admitted a racist breach of peace, the report said.
"The complainer is of Indian and Pakistani origin but British born, and is employed in the store as a trainee," Depute fiscal Ziad Hassan said.
"She asked him to join her at her desk and she would book him in as is standard procedure. She noted he appeared hesitant but eventually he came and sat down," Mr Hassan was quoted as saying.
The accused asked her if she would be his optician for the day but she explained she would only be booking him in, according to Mr Hassan.
"He then stated, 'I'm sorry to be impersonal but I'd rather be seen by a white person'. The complainer was taken aback by this and other staff in the shop overheard the comments," he said.
"The accused stated 'Manchester was the last straw' and he was asked to leave and police were contacted," Kathleen McNulty, defending, said.
"His wife says his filter has gone but I'm not trying to diminish what was said to this lady...he spent time in the cells as a result and this will now follow him," she said.
Sheriff Stewart said, "I'm shocked and I think everybody in this courtroom is shocked by that utterly bigoted and prejudicial narration."
"Prejudice is a cancer which eats away at society and stops it being a place in which we feel safe," Stewart said.
Mr Greene would be sentenced next month.