Court sets man free despite confessing to killing his lover