Joshua Petersen, 21 --the man accused of shooting his 5 month old son to death in April -- will spend the rest of his life in prison.

He entered a guilty plea this week, to avoid the death penalty.

He will not have the opportunity to be paroled.

Police say Petersen attempted to kill himself -- after killing Ryker -- but a family member stopped him.