Age 18 years or above at the time of signing the informed consent.
Diagnosed with T2D ≥ 180 days before screening.
Haemoglobin A1c (HbA1c) 7.0 -10.0% (53-86 millimole per mole (mmol/mol) (both inclusive) as measured by the central laboratory at screening.
Treatment with lifestyle intervention, and/or with 0-3 marketed oral antidiabetic drugs (OADs) (Metformin, glinide, thiazolidinedione, sodium-glucose cotransporter-2 inhibitors, α-glucosidase inhibitors, imeglimin, or sulfonylureas (SU) as a single agent or in combination) according to local label. Treatment with OADs should be stable (same drug(s), dose and dosing frequency) before screening.
Clinical diagnosis of knee OA (American College of Rheumatology criteria) with radio-graphic changes (Kellgren-Lawrence grades 2 to 3 as per central reading) in the target knee. Target knee joint is defined as most symptomatic knee at screening. If pain in knees is equal, the target knee joint will be the dominant leg.
Symptomatic knee OA with first appearance of pain in the target knee \> 90 days prior to screening and pain in the target knee for \> 15 days over the prior 30 days.
Willingness to complete a 72-hour washout period of analgesics before all visits in-volving WOMAC Osteoarthritis Index NRS 3.1 (24-hour) (WOMAC) questionnaire (acetaminophen 4 gram/day is allowed as rescue medication up until 24 hours before those visits).
You may not be if
\- Treatment with glucagon-like-peptide-1 (GLP-1) receptor agonists (RA), dual GLP-1/gastric inhibitory peptide (GIP) RAs (or any other GLP-1 based treatment) or amylin analogues before screening.
HbA1c ≥ 6.5% (48 mmol/mol) as measured by the central laboratory at screening.
History of type 1 or type 2 diabetes mellitus.
Known hypoglycaemic unawareness as indicated by the investigator according to Clarke's questionnaire question 8.
Recurrent severe hypoglycaemic episodes within the last year as judged by the investigator.
Renal impairment with estimated Glomerular Filtration Rate (eGFR) \< 30 millilitre per minute per 1.73 m\^2, (2021 Chronic Kidney Disease Epidemiology Collaboration (CKD-EPI) formula (by creatinine)), at screening.
Participant with diabetic retinopathy or maculopathy who received treatment with retinal photocoagulation, vitrectomy or anti-Vascular Endothelial Growth Factor (anti-VEGF) within 180 days before screening or are expected to require treatment within 180 days after screening.
Diabetic retinopathy or maculopathy must be verified by an eye examination per-formed within 90 days before screening or in the period between screening and randomisation.
Pharmacological pupil-dilation is a requirement unless using a digital fundus photography camera specified for non-dilated examination.
Any joint prosthesis or joint replacement in the target knee.
Arthroscopy or injections into the target knee within the last 90 days prior to screening.
Any other joint disease in the target knee including gout and pseudogout.