Gardai told Letterkenny District Court that they spotted Patrick Quinn, 20, from Cloghan, in a car with 40 different fireworks.
Gardai spotted Quinn giving the fireworks to a schoolboy and the schoolboy running away.
Quinn, who was unemployed but is now on a back-to-work scheme, admitted buying the fireworks across the Border in the North.
However his solicitor said he was not selling the fireworks but simply giving them out to friends.
Judge Paul Kelly said he hoped Quinn had learned a lesson and warned him how dangerous fireworks were.
He ordered a sum of €150 be paid to the Little Angels school and ordered the destruction of the fireworks.