Techniques for detecting ischemia and classifying a type of ischemia are described. Electrograms of cardiac activity may be generated using implanted or external electrodes, e.g., electrodes carried on vascular leads within the heart and a housing electrode. In some examples, ischemia is detected and classified as benign or malignant based on whether a change an electrogram metric is detected, or first detected, in an endocardial electrogram or a non-endocardial electrogram. The relative timing of the change in the electrogram metric and a change in heart rate or patient activity may also be considered. In some examples, the system may create a stress test for detecting ischemia by instructing the patient to exercise or increasing the cardiac pacing rate.