Background and objectives: Many Deep Learning (DL) models have demonstrated high performance in automated ECG diagnosis, though some of them are developed on small datasets or biased towards a certain clinical condition. In this study, we employ Adversarial Multitask Learning (AML) to identify Myocardial Infarction (MI) from ECG signals while mitigating the influence of age on model predictions. Method: ECG recordings from healthy control and MI patients were extracted from the PTB-XL dataset and preprocessed to generate a 12-lead average beat. Two DL models sharing the initial layers were trained. The first model was trained to identify MI, while the second one to predict patient's age, with the parameters of the common layers frozen. Finally, the parameters of the common layers were trained by minimizing the classification loss while maximizing the age prediction error, using two different loss functions: i) mean squared error (MSE); and ii) negative squared covariance (NCOV). Results: On the validation set, the first model achieved a classification accuracy of 0.87 while the second one had a Pearson's correlation coefficient (PCC) with age of 0.67. After adversarial training with MSE and NCOV, PCCs with age were -0.78 and -0.03, and accuracies were 0.82 and 0.85, respectively. Conclusion: The proposed AML was able to reduce the correlation between true and predicted age while keeping a good performance for MI identification.