The application of a Markov random fields (MRF) based maximum a posteriori (MAP) estimation method for microwave imaging is presented in this paper. The adopted MRF family is the so-called Gaussian-MRF (GMRF), whose energy function is quadratic. In order to implement the MAP estimation, first, the MRF hyperparameters are estimated by means of the expectation-maximization (EM) algorithm, extended in this case to complex and nonhomogeneous images. Then, it is implemented by minimizing a cost function whose gradient is fully analytically evaluated. Thanks to the quadratic nature of the energy function of the MRF, well posedness and efficiency of the proposed method can be simultaneously guaranteed. Numerical results, also performed on real data, show the good performance of the method, also when compared with conventional techniques like Tikhonov regularization.