The boy was starved of oxygen during his birth at Wrexham Maelor Hospital.
His lawyers sued Betsi Cadwaladr University Health Board, which runs the hospital, claiming clinical negligence.
The health board denied liability, but has now agreed to pay him 60% of the full value of his claim in order to settle the case.
London's High Court heard the boy has cerebral palsy and severe learning difficulties and needs 24-hour care from his parents. The court heard the teenager is only expected to live into his mid-thirties due to his condition.
Mr Justice Foskett told the court he would receive a £1.7m lump sum from the NHS.
He will also get index-linked, tax-free annual payments of £100,000 a year to meet the costs of his care until he turns 19.
From then on, the annual payments will increase to £132,000 a year.
The capitalised value of the settlement was about £3.6m, the judge said.
He said he hoped the money would "go some way to making aspects of his care easier" for his devoted family.
Approving the settlement, the judge said it was in the boy's "best interests" and praised his parents for their "total dedication".
A 14-year-old boy who suffered a serious brain injury when he was born at a Wrexham hospital will receive about £3.6m in NHS compensation.