Court sentences man to life term