The 17-year-old activist, who was shot and nearly killed by the Taliban in Pakistan in October 2012 for insisting girls had a right to an education, said Sharif told her his government would support her if she decided to visit the country.
"He said my country is always there for me. And I said that it is my responsibility as a Pakistani to return to Pakistan and help people there,"
Malala, who has made her home in Britain, told public broadcaster NRK, adding that any visit would have to coincide with her school holidays.
Pakistan's education system, child labour and child marriage were also among the issues discussed, she added.
The ruling Pakistan Muslim League-N (PML-N) party posted a picture of the meeting on its official Twitter account.
The prime minister and the teen met briefly on the sidelines of the UN General Assembly in September 2013, but this was their first official meeting.
Both were in Oslo after attending the two-day Oslo Summit on Education for Development, where Malala urged world leaders to cut "eight days of military spending" to give all children access to 12 years of free education.
Sharif and his Indian counterpart Narendra Modi last year declined to attend the Nobel Peace Prize awards ceremony, where she collected the prize she shared with Indian child rights activist Kailash Satyarthi.
Malala became a global icon after the Taliban attack in 2012, She recovered after being flown for extensive surgery to Birmingham, central England, and has since continued both her education and activism.
But she remains a figure of hate for many Pakistanis who resent having the country's problems aired abroad.