CNN  — 

A British high school student has apologized to Prince Harry for hugging his wife, Meghan, Duchess of Sussex, when she visited his school.

Aker Okoye, 16, embraced Meghan and called her “beautiful” during her surprise visit Friday to Robert Clack School in Dagenham, east London, to mark International Women’s Day on Sunday.

The teenager seized the moment when the duchess invited a “brave young man” to come up discuss the importance of March 8.

After leaning in for what appeared to be a kiss on the cheek, Okoye boldly told his schoolmates: “She really is beautiful, innit.”

The assembly hall immediately erupted in cheers from other students and Meghan was seen laughing and smiling at the compliment.

In a handwritten letter to Harry, published in The Sun newspaper, Okoye told the prince that he hoped his actions weren’t out of line.

“I hope you didn’t mind me cuddling your wife,” he wrote, adding that he was “just overwhelmed and shocked to see her arrive at my school.”

Okoye, who is head boy at the school, went on to say it was “a pleasure to hear her (Meghan’s) speech and to speak in front of her as well. She is truly inspirational.”

The cheeky student signed off by saying he hoped to meet the duke one day and wished the royal couple “good luck for the future.”

Speaking about the viral moment on the “Good Morning Britain” TV show on Monday, Okoye said he wrote to Harry in a bid to avoid controversy.

“There was an Instagram comment on a post that I was on, and they said if I’m dead in the next six months we know who sent the hit out. I thought ‘Ooh, let me cover myself.’”

Asked by interviewer Piers Morgan: “You went in for a long hug. I mean, you took your chance, didn’t you?” Okoye replied: “Of course, of course. Sorry, Harry.”

He told Morgan: “It was one of those moments which I’ll cherish for the rest of my life.”

CNN has reached out to Okoye for comment.

Meghan visited the Robert Clack Upper School in Dagenham, London, on Friday to "celebrate the achievements of women" ahead of International Women's Day

Meghan’s appearance at the school was her final solo royal engagement as a senior royal before she and Harry officially step down on March 31. During her address, she encouraged young men to “value and appreciate” the women in their lives and to “set the example for some men who are not seeing it that same way.”

The royal couple will take part in their last official scheduled engagement Monday when they attend the Commonwealth Day service at London’s Westminster Abbey alongside other senior members of the royal family.