Research Study to Compare Semaglutide Tablets With Empagliflozin or Metformin Tablets in People With Type 2 Diabetes

This study compares the medicines semaglutide with empagliflozin or metformin in people with newly diagnosed type 2 diabetes. This study will look mainly at how well participant's blood sugar and body weight are controlled when they are taking the study medicines. Participants will either get semaglutide tablets, empagliflozin tablets or metformin tablets. Which treatment participants will get is decided by chance. Currently, doses of 3 milligram (mg), 7 mg and 14 mg semaglutide tablets (Rybelsus) can be prescribed in some countries. 25 mg and 50 mg semaglutide tablets are new doses. 10 mg and 25 mg empagliflozin tablets (Jardiance) can be prescribed in some countries. 500 mg metformin tablets (STADA) can be prescribed in some countries. Participants will get 1 to 4 tablets per day for 104 weeks. The study will last for about 2 years and 7 weeks (111 weeks). Participants should not have been treated for weight management 90 days before screening or never been treated with any medicine for type 2 diabetes (except diabetes during pregnancy) before screening. Women cannot take part if pregnant, breast-feeding or plan to get pregnant during the study period.


Eligibility Criteria:
Inclusion Criteria:

* Male or female.
* Age ≥18 and \<60 years at the time of signing the informed consent.
* Diagnosed with type 2 diabetes mellitus within 24 months from the day of screening.
* HbA1c of 7.0-10.0% (53-86 millimoles per mole \[mmol/mol\])
* Body mass index ≥25.0 kilogram per square meter (kg/m\^2)

Exclusion Criteria:

* Treatment with any medication for the indication of diabetes. Prior insulin treatment for gestational diabetes is allowed.
* Treatment with any medication for the indication of weight management 90 days prior to screening.
* Renal impairment measured as estimated glomerular filtration rate (eGFR) \<60 milliliters per minute per 1.73 meter sqaure (mL/min/1.73 m\^2) at screening.
* Uncontrolled and potentially unstable diabetic retinopathy or maculopathy. Verified by a fundus examination performed 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.
* C-peptide \<1.5 nanograms per milliliter (ng/mL) at screening.
* Positive insulinoma associated-protein 2 (IA-2) antibodies ≥7.5 Units/mL or anti-glutamic acid decarboxylase (anti-GAD) antibodies greater than (\>) 5.0 international units per milliliter (IU/mL).
* Impaired liver function, defined as Alanine aminotransferase (ALT) ≥2.5 times or Bilirubin \>1.5 times upper normal limit at screening.
* History of major surgical procedures involving the stomach potentially affecting absorption of trial products (example subtotal or total gastrectomy, sleeve gastrectomy, gastric bypass surgery) or current presence of gastrointestinal implant.
* Presence of clinically significant gastrointestinal disorders affecting absorption of drugs and/or nutrients, as judged by the investigator.
* Any contraindications for empagliflozin or metformin according to local labelling at the investigator's discretion