Inclusion Criteria:  Cohort 1 (R/R AML):  - Patients with AML who have failed first line induction chemotherapy (consisting of a minimum of two intensive chemotherapy cycles, e.g. 7+3 or HAM) or patients with AML who have relapsed after achieving complete remission (CR), CRi, or CRp, or patients who have failed up to one prior salvage therapy  Cohort 2 (frontline older AML):  - Patients aged ≥65 years with previously untreated AML who are unfit for or decline standard induction therapy.  General inclusion criteria:  Patients not eligible for intensive induction chemotherapy and/or allogeneic stem cell transplant. Age ≥18 years ECOG Performance Status ≤2 Adequate organ function:  Total bilirubin ≤2 x ULN (≤3 × ULN if due to leukemic involvement or Gilbert's syndrome) AST and ALT ≤2.5 × ULN (≤5.0 × ULN if due to leukemic involvement) Serum creatinine ≤2 × ULN or glomerular filtration rate (GFR) ≥50 mL/h  Adequate cardiac function: TTE with documented LVEF ≥50% At least 2 weeks OR at least 5 half-lives interval from prior treatment to time of initiation of study medication GvHD of grade ≤A on ≤10 mg prednisone without any additional immunosuppressive therapies (tacrolimus, ciclosporin, etc.) Written informed consent Negative pregnancy test and adequate methods of contraception for females of childbearing potential, adequate methods of contraception for males  Exclusion Criteria:  Acute promyelocytic leukemia (APL) Biphenotypic or bilineage leukemia Known allergy or hypersensitivity to 5-azacytidine, nivolumab, relatlimab, or any of their components History of life-threatening toxicity related to prior immune therapy Previous treatment with immunotherapeutic drugs targeting PD-1/PD-L1 in combination with 5-azacytidine Previous treatment with LAG-3 targeted agents Known history of severe interstitial lung disease or severe pneumonitis Known history (active, known, or suspected) of any of the following autoimmune diseases:  inflammatory bowel disease rheumatoid arthritis systemic progressive sclerosis systemic lupus erythematosus autoimmune vasculitis  Active uncontrolled pneumonitis Active uncontrolled infection Symptomatic or poorly controlled CNS leukemia Confirmed history of encephalitis, meningitis, or uncontrolled seizures in the year prior to informed consent Uncontrolled or significant cardiovascular disease Troponin T (TnT) or I (TnI) > 2 × institutional ULN Organ allografts Allogeneic hematopoietic stem cell transplantation within the last 100 days before first study drug administration Active GvHD > grade A Known human immunodeficiency virus seropositivity Known positivity for hepatitis B by surface antigen expression or active hepatitis C infection Other medical, psychological, or social condition that may interfere with study participation or compliance, or compromise patient safety Patients unwilling or unable to comply with the protocol Patients who are pregnant or breastfeeding Prisoners and subjects who are compulsory detained