Former Government adviser Phil Flynn had the Probation Act applied to him at Dublin District Court today.
In court this morning he was asked to pay €5,000 to charity by Judge Ann Ryan when he appeared on charges of possession a weapon and ammunition.
A legal representative for Mr Flynn has given an undertaking to the court that the money will be paid to Fr Peter McVerry within 72 hours.
The money will be paid to the Dublin-based Jesuit priest Fr McVerry, who works with homeless boys.
Mr Flynn, who is 65 years old, appeared on charges of possession of a pen gun and two mini teargas canisters without a licence at his office in Harcourt Street, Dublin, on 17 February last.
Judge Ryan said that the court accepted that Mr Flynn had an unlawful gun and ammunition but that it had not been concealed and had been held for around 30 years.
He had no previous conviction and a long history of service to the State.