A man who caused €1.25m damage and left 25 people homeless when he set fire to his girlfriend's flat has been jailed for five-and-a-half years.
John McGovern (25) torched the flat in Station Hill, Clongriffin, last November after a "vicious attack" on his girlfriend.
The fire then spread to other flats in the building.
McGovern was "out of his mind" on drugs and drink at the time, Dublin Circuit Criminal Court was told.
Judge Karen O'Connor said he was at very high risk of re-offending, but noted he was making good use of his time in custody and was trying to find a way to rehabilitate himself.
She suspended the last 12 months of a six-and-a-half year prison sentence.
McGovern, of Shangan Terrace, Ballymun, admitted arson causing damage to a number of flats and assault causing harm to his girlfriend, Grainne O'Brien.
Judge O'Connor said he had endangered the lives of the residents in the flats and that the financial loss to those who had lost their homes had been considerable.
She said the "vicious attack" on Ms O'Brien in the presence of her child had been "frightening" and "painful".
The court was told the couple had a tumultuous relationship and that they had been drinking heavily in the days leading up to the fire.
On the morning of the fire, McGovern threw a vacuum cleaner at Ms O'Brien as she lay in bed before kicking and punching her.
He then left the flat and went to the Travelodge in Ballymun, where he took controlled drugs and continued to drink.
Later that day, Ms O'Brien's ex-partner visited her, bringing their young child with him. He said Ms O'Brien had a black eye, a split lip and was missing a tooth.
McGovern returned in an "agitated state" and threatened to hit Ms O'Brien's ex-partner. Ms O'Brien ran to a neighbour's home and asked her to call gardai.
Ms O'Brien then saw her flat "on fire" as McGovern stood on the far side of nearby train tracks shouting, "Look at your gaff Grainne, I'm after setting it alight".
McGovern caught a train to Raheny Station, where he was arrested after he was seen acting erratically with a knife.
When questioned by gardai, he blamed the fire on Ms O'Brien and her ex-boyfriend.
McGovern had 26 previous convictions, including those for theft, public order offences and escaping from custody.
The court was told it took 14 fire trucks four-and-a-half hours to bring the fire under control. All the residents were evacuated and six homes were destroyed. Others were badly damaged by water.
Twenty-five people were left homeless, including a young child with cancer.
One of them described how he and his daughter had lost all their furniture. Another described how she experienced depression as a result of the fire.
Sean Guerin, defending, said his client failed to take his prescribed anti-psychotic pills in the days leading up to the fire.
He said that, along with the alcohol and drugs, led to a "cocktail of reasons" why he was "out of his mind".
A letter of apology from his client described the fire as the "worst mistake of my life".
"If I could turn back the clock, I would," he said. He described his actions as "irresponsible and unacceptable".
McGovern had been in custody since the fire, was now drug-free and eager to make progress, said Mr Guerin.
Judge O'Connor backdated the sentence to November 1, 2016, and ordered McGovern to keep the peace and be of good behaviour for two years, on release.
McGovern was also ordered to remain under the supervision of the Probation Services for two years and attend programmes as directed.