The couple are on their first trip to Africa's most populous nation, prompted by links forged through the Invictus Games, an international sporting event he started a decade ago for military personnel wounded in action.
Harry said Nigeria had expressed interest to host the 2029 games.
The couple were invited to Nigeria by the chief of defence staff Christopher Musa who told them the armed forces faced armed criminal gangs and jihadists and that improvised explosive devices presented "the greatest challenge".
The 39-year-old Duke of Sussex then travelled to a military hospital in Kaduna where he met wounded soldiers.
In Abuja, Harry and Meghan visited Lightway Academy, which is run by a non-profit organisation supported by their Archewell Foundation. They were received with wild cheers and serenaded by dancers and singers.
They spoke about mental health, which carries deep-rooted stigma in conservative Nigeria.
"Too many people don't want to talk about it 'cause it's invisible. It's something in our mind that we can't see. It's not like a broken leg, it's not like a broken wrist," said Harry.
"Every single person in this room, the youngest, the oldest, every single person has mental health. So therefore, you have to look after yourself to be able to look after other people," Harry said, adding that "there is no shame" to acknowledge it.
Meghan said they were honoured to make their first visit to Nigeria and urged the students not to suffer in silence.
"Just make sure that you are taking care of yourselves and that begins with your mental health by really talking about whatever's coming up for you," she said.
The couple also visited a kindergarten class, and when introduced to a five-year-old student, the oldest in the class, Meghan said: "Our son Archie's five. He turned five last week."
REUTERS