A man convicted in a brutal Millburn home invasion beating caught on a home surveillance camera lost an appeal of his conviction and life sentence Friday.

Shawn Custis was convicted in 2016 for the home invasion in which a four-minute video showed a woman being repeatedly kicked and punched and thrown down a flight of stairs as her 3-year-old daughter sat motionless on a couch.

The woman testified at Custis' sentencing that she suffered a fractured bone in her back and had been afraid to open a window in her home since the attack.

Custis' criminal record included 38 arrests and 17 felony convictions before the 2013 attack. Prosecutors cited his record in asking for an extended sentence. In addition to a life sentence, he received a consecutive sentence for child endangerment. The jury acquitted him of attempted murder.

Despite this rap sheet, previous plea deals had always allowed Custis to leave prison after serving stints of just five years or less.

WARNING: VIDEO BELOW EXTREMELY GRAPHIC

A police officer who responded to the scene was overheard on the same surveillance video using a racial slur to refer to the then-unknown assailant. He testified at trial that he didn't question Custis and didn't collect evidence in the case. The prosecutor declined to charge the officer.

In his appeal, Custis' attorneys had argued his life sentence was excessive and that key evidence against him should have been suppressed. Among that evidence was the testimony of four women who identified Custis based on the surveillance footage.

Custis also argued that the victim's identification of him was tainted and that items seized from his girlfriend's apartment should have been excluded.

The appellate rejected the various arguments and held that the sentence was reasonable given the seriousness of the crime and Custis' extensive criminal history.

The three-judge panel also ordered the record to show that Custis' convictions for robbery and aggravated assault should be merged in the record. That won't affect the overall sentence, according to the Essex County prosecutor's office.