Acquiring both anatomical and functional images during one scan, PET/CT systems improve the ability to detect and localize abnormal uptakes. In addition, CT images provide anatomical boundary information that can be used to regularize positron emission tomography (PET) images. Here we propose a new approach to maximum a posteriori reconstruction of PET images with a level set prior guided by anatomical edges. The image prior models both the smoothness of PET images and the similarity between functional boundaries in PET and anatomical boundaries in CT. Level set functions (LSFs) are used to represent smooth and closed functional boundaries. The proposed method does not assume an exact match between PET and CT boundaries. Instead, it encourages similarity between the two boundaries, while allowing different region definition in PET images to accommodate possible signal and position mismatch between functional and anatomical images. While the functional boundaries are guaranteed to be closed by the LSFs, the proposed method does not require closed anatomical boundaries and can utilize incomplete edges obtained from an automatic edge detection algorithm. We conducted computer simulations to evaluate the performance of the proposed method. Two digital phantoms were constructed based on the Digimouse data and a human CT image, respectively. Anatomical edges were extracted automatically from the CT images. Tumors were simulated in the PET phantoms with different mismatched anatomical boundaries. Compared with existing methods, the new method achieved better bias-variance performance. The proposed method was also applied to real mouse data and achieved higher contrast than other methods.