Abstract Background Stroke and acute myocardial infarction (AMI) are cardiovascular diseases commonly characterized by the development of atheromatous plaques associated with major complications and high mortality rates. Objective To identify an epidemiological trend in hospitalizations due to stroke and AMI and to analyze the relationship between health programs applied in Primary Health Care, gender and the Federative Unit. Methods Ecological study with a time series design between 1998 and 2018, collecting data from all federal units in Brazil stratified by, gender and place of residence. There were analyzed Hospitalization Authorizations (AIH) for stroke and MI, consulting the Hospital Admissions System (SIH) of the Informatics Department of the National Health Service with p <0.05. Results From 1998 to 2018, the rate of hospitalization for AMI increased in Brazil approximately 42.58 events per 100 thousand inhabitants annually (p<0.001), while hospitalizations for stroke declined 32.17 cases (p=0.03). This pattern was observed in both sexes in AMI and stroke. There is also evidence of the effect of the Hiperdia (p<0.001) and Mais Médicos (p=0.001) program in reducing stroke and Hiperdia cases in mitigating the evolution of AMI cases (p = 0.0001). Conclusion Although these diseases remain as an important cause of death, stroke hospitalization has reduced significantly in the period evaluated. National programs as the Hiperdia and Mais Médicos showed an impact in the acute cases of strokes and AMI.