A patient had a patent foramen ovale that caused right-to-left shunting and stroke during massive pulmonary embolism. After inhalation of nitric oxide resulted in right-to-left atrial pressure gradient reversal and increased mixed venous partial pressure of oxygen, contrast transesophageal echocardiography showed closure of the patent foramen ovale before the patient died.