A man caused £40,000 worth of damage by destroying iPhones and iPads in a rampage at an Apple store in Leeds city centre.
Joshua Wilson put on a pair of headphones and shouted 'Satan is in my head' before smashing up electrical items at the store in Trinity Leeds.
Shoppers were stunned by the outburst which happened at 5.30pm on February 4 this year.
Leeds Crown Court heard the total value of the damage was £40,412.
Vincent Blake-Barnard, prosecuting, said customers looked on as Wilson picked up display items and threw them on to the floor.
Wilson was aggressive towards members of staff as they tried to get him to stop damaging products.
Mr Blake-Barnard said Wilson then stopped, sat on a table and waited for police to arrive.
In a separate incident, Wilson ripped a panel off a kiosk at a Sainsbury's store and threw cans of alcohol at a till.
Wilson also shouted racial abuse at a security guard during the outburst at the Headrow store in Leeds city centre on June 23 last year.
He continued to make racially offensive remarks and shouted "Lucifer" when police arrived.
Wilson, 23, of Valley Road, Pudsey, kicked an officer to the leg when he was being arrested.
He pleaded guilty to two offences of criminal damage, two of racially aggravated assault and common assault.
He has previous convictions for criminal damage.
Adrian Pollard, mitigating, said Wilson has a history of mental health problems and drug and alcohol abuse.
Mr Pollard said Wilson was struggling to get support from mental health services at the time of the offences and "flipped out" in frustration.
He urged judge Mushtaq Khokhar to impose a community-based punishment so he could continue to receive treatment.
Wilson was made the subject of an 18-month community order, with a requirement to attend a drug and alcohol recovery programme.
Judge Khokhar said: "No matter how rich an organisation, this was still a lot of damage and a serious offence.
"More importantly, you hurt other people's emotions by using racist language.
"I do not know if you have ever been on the receiving end of it, because if you have been, you would realise how deeply upsetting it is."