Militants fired mortars on a Shiite shrine north of Baghdad late on Thursday, and in the confusion that followed, three suicide bombers in military uniforms infiltrated the compound and blew themselves up, the Iraqi authorities said. At least 36 people were killed and more than 40 were wounded.