A 19-year-old in Gainesville was sentenced Thursday to 25 years in prison after he attempted to rape a woman during a burglary three years ago, authorities said.

Edricus Jumario Mayfield was found guilty on all charges, including aggravated sexual battery, attempted rape and kidnapping, District Attorney Lee Darragh confirmed to Channel 2 Action News.

In June 2016, the Flowery Branch man broke into the woman’s home at the Vineyard Way apartment complex and beat her with a baseball bat, authorities said. According to warrants, that caused bruising on the victim’s arms.

He also was charged with third-degree child cruelty because two children, ages 4 and 9, witnessed the attack.

He was arrested in April 2018 after Gainesville police were able to match fingerprints collected at the scene to Mayfield, AJC.com previously reported. He had been arrested on unrelated charges, prompting authorities to fingerprint him, which ended up matching the 22-month-old prints.

RELATED: Police: Fingerprints lead to arrest in 2016 home invasion case

Following his time in prison, he will spend the rest of his life on probation, Darragh said.

In other news:

Atlanta police tell Channel 2 Action News the man was coming out of the parking lot of the West Lake station when he was hit by a red Cadillac.