He made a second attempt but quickly gave up and returned to his car after the girl's brother began screaming.
"The horrific nature of the crime you have committed," Judge Alice Dubow told Figueroa-Fagot, prompted her to issue such a lengthy sentence.
The judge also ruled that Figueroa-Fagot, who was convicted in September of attempted kidnapping and five related charges, was a sexually violent predator under Megan's Law, which requires him to report to police every 90 days when he is released.
Figueroa-Fagot shook in his chair through much of the hearing. His hair was nearly to the shoulders of his bright-blue shirt, and his beard was thick and bushy.
A native of Puerto Rico, he listened to an interpreter throughout the hearing and declined to address the court.
Assistant District Attorney Branwen McNabb urged the judge to sentence Figueroa-Fagot to the maximum of 26 to 52 years in prison.
McNabb said Figueroa-Fagot took away the family's "ability to feel safe in their own neighborhood."
The attack was an unspeakable crime, McNabb said. "It's every parent's worst nightmare."
After the hearing, the girl's mother said she was extremely happy with the sentence. She also thanked the prosecutors, police, and court staff.
"My kids are safe. I am going to be a grandmother before he even comes up for parole," the woman said.
She told the judge the attempt had traumatized her children. She said her daughter refuses to leave the house alone.
"She constantly looks over her shoulder, thinking someone might try to grab her," she said.
She added that both children have nightmares as a result of the attack.
She said she had not been able to work in more than a year because she was afraid to leave her children.
McNabb hailed the children's courage in fighting off their attacker.
"They were so young," he said. "And they fought with the strength that most adults couldn't muster up under such scary and terrifying circumstances, and that strength carried with them for almost two years until today. They should really be commended."