One week before senior prizegiving, 18-year-old Jake Bailey was told he might not live to see the day.
The Christchurch Boys' High School senior monitor, or head boy, was diagnosed with one of the world's fastest growing tumours - Burkitt lymphoma - last week.
He had written a speech for prizegiving before his diagnosis and managed to leave his hospital bed to deliver it from a wheelchair on Wednesday.
It has since been watched more than 1500 times on YouTube.
"I wrote a speech. And then, a week before I was due to deliver that speech tonight, they said 'You've got cancer'," Jake said in the speech.
"They said 'If you don't get any treatment within the next three weeks you're going to die.
"And then they told me I wouldn't be here tonight to deliver that speech."
Burkitt lymphoma is fatal if left untreated but can be fought with intensive chemotherapy. Jake started his treatment last week.
Jake's emotional speech goes on to urge his fellow students to strive for success and be the best people they can be throughout their lives.
He told his peers they had only one life to live.
"I wrote this before I knew I had cancer and now I have a whole new spin on it," he said.
"Here's the thing, none of us get out of life alive. So be gallant, be great, be gracious and be grateful for the opportunities that you have.
"The opportunity to learn from the men who walked before you and those who walk beside you," he said.
Jake also thanked the many teachers, old boys and staff at Christchurch Boys' High School for helping him, as well as helping his year group, become "ready to move on [as] men".
At the end of the speech, Jake struggled to hold back tears alongside a large number of the listeners.
He will not be sitting Year 13 exams with his classmates this year.
"I don't know where it goes from here for any of us. For me, for you.
"But I wish you the very best in your journey and I thank you for being part of mine.
"Wherever we go and whatever we do, may we always be friends when we meet again."
A rousing haka and emotionally charged rendition of the school song followed the end of his speech.
Principal Nic Hill said the boys' response was spontaneous, as the school had not been sure whether Jake would make it to prizegiving from his hospital bed.
Almost everyone listening to his speech had tears in their eyes, he said.
"It was certainly [teary]. I got up to make my speech and felt a bit emotionally drained. I think the thing is just the effort he made to get there as well.
"It was a great evening, as well as Jake's great speech, but I sort of wondered when he left how we were going to carry on."
The school and its wider network would be thinking of Jake's family in the "tough road ahead", he said.
"X factor is the word to use about Jake. [He's got] maturity, and he'll never let anyone down. Those are the three phrases that sum him up.
"The school's thoughts and prayers are with him and his family," Mr Hill said.
"It was a privilege to have him there last night but we also understand how much it probably took out of him."
What is Burkitt lymphoma?
• Burkitt lymphoma is a form of non-Hodgkin's lymphoma, where cancer starts in the immune cells.
• It is recognised as the fastest growing human tumour.
• The cancer is related to impaired immunity and fatal if untreated.
• It was named after British surgeon Denis Burkitt, who first identified the disease among children in Africa in the 1950s. The cancer is rare outside of Africa.
• Intensive chemotherapy is the preferred treatment.