A Dublin teenager, who used his great-grandfather's sword from the 1916 Rising to stage a "one-man rebellion" at Leinster House in April, has been sentenced to 200 hours of community service.

Jordan Buckley, 19, from Kells Road, Crumlin, charged into the yard of Government Buildings with the sword raised high and knives concealed in his clothing, Dublin District Court heard today.

Judge Michael Walsh said the community service work must be carried out if Buckley is to avoid a ten-month jail sentence.

Buckley developed a "hair-brained scheme" because he could not find work and had issues with the Government's austerity measures, the judge heard.

First-time offender Buckley pleaded guilty today to trespassing with a weapon at Leinster House on 29 April.

He also admitted trespassing with intent to cause fear and resisting arrest in connection with the same incident.

The Dáil was not sitting on the day, however, members of the Oireachtas and the public were present, but no one was injured during Buckley's attempted attack.

In evidence, Garda Dwayne Conlon told Judge Walsh that at around 4.30pm he had been on duty at the front yard of Leinster House when Buckley ran in "carrying a large sword in his hand".

Garda Conlon said he drew his baton and Buckley came to halt and raised the sword "as if he was preparing to strike". He said Buckley came towards him to "stop me advancing on him".

The 19-year-old then ran around Garda Conlon and made for the doors of Leinster House. However, the garda gave chase and caught up with Buckley, who had reached the building's revolving doors.

"I managed to grab him and pull him to the ground, he was still in possession of the sword and I ordered him to drop it," Garda Conlon said.

During the struggle another garda hit Buckley with a baton to "get him to relinquish the sword", after which he was arrested.

Garda Conlon said that following the arrest he noticed three knives protruding from the accused's clothing. Later that evening, a fourth knife was found in the car park area.

Defence solicitor Paul Hannon said he wanted to give credit to Garda Conlon "for his bravery in the line of duty".

Mr Hannon asked the judge to note that Buckley, who has no prior criminal convictions, had left school early. He then had a "struggle finding work" and had issues with the Government's austerity measures. 

The garda agreed with Mr Hannon that it was "a misguided and ill-conceived stunt on the part of a disaffected youth". The garda also agreed Buckley was co-operative after his arrest.

In pleas for leniency, Mr Hannon asked the judge to note that it was not a premeditated incident.

"The sword was his great-grandfather's sword from the 1916 rebellion", said Mr Hannon, adding that it was a "family heirloom used for symbolic reasons".

Buckley's ancestor had also served as cavalry captain in the Irish Army during the Civil War.

Mr Hannon said his client had no real interest in politics and except for the Taoiseach, he does not know what members of the Government look like.

The knives were for self-defence in case he came "under attack", the lawyer explained.

He also said that after Buckley was originally charged earlier this year he had spent a period in jail on remand and that "served as a short, short shock and brought him to his senses". 

"The expression 'the devil makes work for idle hands' at times comes to mind," Mr Hannon said 

Buckley has since signed up for an educational course and now hopes to complete the Leaving Certificate, the court heard. The garda confirmed he has also kept out of trouble.

The judge noted that the Probation Service had carried out an assessment and found that Buckley was a suitable candidate for a community service sanction.

The judge ordered him to perform 200 hours work in lieu of a ten-month prison sentence.