Follow CBSMIAMI.COM: Facebook | Twitter

MIAMI (CBSMiami) — The man accused in a deadly shooting rampage inside Ft. Lauderdale-Hollywood International Airport plead guilty Wednesday morning.

READ MORE: Teen Sister Of Officer Yandy Chirino's Accused Killer Taken Into Custody

Esteban Santiago appeared in Miami federal court where he entered guilty pleas to killing five people and injuring six others when he opened fired in a baggage area of the airport in January 2017.

This is all part of a plea agreement to avoid the death penalty. Santiago agreed to plead guilty in exchange for a life sentence.

He also agreed to five consecutive life sentences followed by 120 years in prison.

READ MORE: Miami Weather: Brief Downpours Possible Sunday Before Drier Air Works Its Way In

The judge called for a separate sentencing hearing to allow families and victims to speak.

Prosecutors say the families and victims of everyone killed and injured have agreed to the plea.

Santiago, a National Guard Iraq war veteran, was briefly hospitalized in Alaska about two months before the airport shooting after complaining of mental problems but was released with no restrictions on possessing a gun.

MORE NEWS: Doral Police ID Officers Injured In Friday's Shooting

Santiago is scheduled to be sentenced on August 17.