A Baldwin man faces up to 25 years to life in prison after trying to set fire to his ex-girlfriend’s house on two separate occasions, authorities said.

Joseph Ferrufino, 22, was arraigned Friday by acting Supreme Court Justice Teresa Corrigan and faces seven counts of attempted murder in the second degree.

He pleaded not guilty to the charges and is due back in court on Jan. 13.

Authorities say Ferrufino first attempted to set the Harrison Avenue house ablaze on the evening of Nov. 17 by throwing a Molotov cocktail at the front bay window of the Baldwin home. The bottle did not shatter the glass.

Three people were in the house at the time. A resident there chased Ferrufino down the street but he got away, authorities said.

Nassau police, who were called to the scene but were unable to find the suspect, installed an emergency electronic alert system inside the home.

advertisement | advertise on newsday

On the morning of Nov. 24, Ferrufino is alleged to have thrown yet another Molotov cocktail through a second story window. It started a fire in the bedroom.

A teenager in the house suffered a laceration to her foot from broken glass, police said, and an adult woman in the home suffered from smoke inhalation and first-degree burns on her legs.

Authorities say Ferrufino also poured a flammable liquid on a car in the driveway, a white 2015 Mercedes ML350.

Four people were home at the time of the second attack. A resident of the home, who recognized the assailant as his daughter’s ex-boyfriend, chased Ferrufino down the street but was unable to catch him, prosecutors said.

NCPD First Precinct officers, responding to the alarm’s activation, soon arrived at the scene and began searching for the suspect. authorities said. Ferrufino was discovered nearby.

Two NCPD officers suffered minor injuries as they apprehended him, police said.

In addition to the attempted murder charges, Ferrufino faces multiple arson charges, four counts of criminal possession of a weapon in the third degree, reckless endangerment in the first degree and resisting arrest.

Authorities have said Ferrufino and his ex-girlfriend had dated for two years but had limited contact since the relationship ended in 2013.

Ferrufino’s attorney could not be reached for comment.