Findlay Duncan was spotted holding the pyrotechnic device in the Shed end at Dundee United's Tannadice Stadium - which was housing Aberdeen fans for the Ne'erday clash.
He was seen by police with the device after a string of smoke bombs and flares were set off in the stand.
Duncan had faced a jail term when he appeared at Dundee Sheriff Court yesterday.
But a sheriff instead told him he would do 120 hours' community service and be banned from attending any football match for two years.
Duncan, 21, of Kellands Road, Inverurie, earlier admitted being in possession of a smoke grenade January 1, 2014, at Tannadice Park.
Christopher Maitland, defending, said Duncan - who has a previous conviction for behaving in a threatening and abusive manner - was "deeply remorseful".
He said: "He did not arrive at the game in possession of the flare - he was given it in the stand and only possessed it for about a minute. He did not know how to set it off and had no intention to set it off.
"He has expressed remorse and appears to have learned his lesson having spent two days in custody."
Sheriff Tom Hughes said: "This type of conduct is totally unacceptable and has been causing concern for football authorities and fans.Flares are extremely dangerous."
Aberdeen won the Premiership clash 2-1.