The mortgagor and mortgagee may agree on a termination of the mortgagor's interest in the mortgaged real estate after a default by a mortgagor. Any mortgagee or mortgagee's nominee may accept a deed from the mortgagor in lieu of foreclosure subject to any other claims or liens affecting the real estate. Acceptance of a deed in lieu of foreclosure shall relieve from personal liability all persons who may owe payment or the performance of other obligations secured by the mortgage, including guarantors of such indebtedness or obligations, except to the extent a person agrees not to be relieved in an instrument executed contemporaneously. A deed in lieu of foreclosure, whether to the mortgagee or mortgagee's nominee, shall not effect a merger of the mortgagee's interest as mortgagee and the mortgagee's interest derived from the deed in lieu of foreclosure. The mere tender of an executed deed by the mortgagor or the recording of a deed by the mortgagor to the mortgagee shall not constitute acceptance by the mortgagee of a deed in lieu of foreclosure.
735 ILCS 5/15-1401