Medical ethics and law are essential topics that should be included in medical residency programs. However, surgery training programs in Iran lack a specific course in medical ethics and law, which can lead to patient dissatisfaction with surgical outcomes. This study aimed to assess surgery residents' knowledge of medical ethics and law and suggest improvements for future residency programs. This descriptive cross-sectional study involved 112 surgery residents from six teaching hospitals. A valid and reliable questionnaire comprising 15 items on medical ethics and 12 items on medical law was used to assess participants' knowledge. Most participants were female (31-40 years old), and their mean knowledge score for medical ethics was 3.26±0.53 out of 5, with the lowest score in "futile treatment and DNR orders." The mean knowledge score for medical law was 3.69±0.69, with the lowest score in "surrogate decision-maker." Age did not affect residents' knowledge, but gender did, with female residents demonstrating significantly better knowledge of medical ethics (3.344/5 vs. 3.112/5) and law (3.789/5 vs. 3.519/5). Surgery residents had a relatively favorable knowledge of medical ethics and law, but they require further training in some areas to improve their knowledge. Training should include journal clubs, role-play programs, standardized patient programs, and debates to achieve better results, as purely didactic lectures appear inadequate.