Global rights icon Malala Yousafzai said Thursday she was thrilled to be back in Pakistan, marking her first visit to the country in six years.

"I am thrilled to be back after years. Can't believe I am in my own country," an emotional Malala said at a welcome ceremony at the Prime Minister's Office in Islamabad.

"If it were up to me, I would never have left this place," she added.

"Always it has been my dream that I should go to Pakistan and there, in peace and without any fear, I can move on streets, I can meet people, I can talk to people.

"And I think that it's my old home again ... so it is actually happening, and I am grateful to all of you."

She said her focus was on education in Pakistan, adding that it was necessary to empower females through education.

"We have to invest in education. Our generations to come are the future of Pakistan."

Malala and her family retruned to Pakistan early today on a four-day visit. It is Malala’s first visit to Pakistan in six years after being shot by the Taliban.

The 20-year-old's unannounced arrival with her parents under tight security at Islamabad's international airport overnight has been met with a tsunami of social media reaction, with many Pakistanis hailing her bravery but others accusing her of a conspiracy to foment dissent.

Malala is widely respected internationally as a global icon for girls' education, but opinion is divided in Pakistan where some conservatives view her as a Western agent on a mission to shame her country.

Her schedule for the four-day trip is being closely guarded.

"She will be meeting several people here but her itinerary is not being disclosed due to security reasons," foreign office spokesman Muhammad Faisal told AFP.

"We welcome Malala.... She is back home. It is a positive development," he said, calling her "one of our young and brilliant daughters" and adding that Pakistanis should respect her.

Residents of Malala's native Swat valley, where she lived until the shooting, said they were happy to see her return.

"I had not imagined that she would ever come (back)," Rida Siyal, a student who said she had been a "good friend" of Malala's before the shooting, told AFP.

"(She) defeated the dark force of fear. We are delighted to see her back," she said.

Ahmad Shah, who said he was a friend of Malala's father, called her a "symbol of courage", adding: "She should have returned home much earlier".

Malala became a global symbol for human rights after a gunman boarded her school bus in Swat on October 9, 2012, asked "Who is Malala?" and shot her.

She was treated for her injuries in the British city of Birmingham, where she also completed her schooling.

The youngest ever winner of the Nobel Peace Prize in 2014, she has continued to be a vocal advocate for girls' education while pursuing her studies at Oxford University.

"I welcome #MalalaYousafzai the brave and resilient daughter of Pakistan back to her country," politician Syed Ali Raza Abidi wrote on Twitter, one of many Pakistanis expressing joy at her return, despite ongoing security fears.

In 2007 the Islamist militants had taken over the area, which Malala affectionately called "My Swat", and imposed a brutal, bloody rule.

Opponents were murdered, people were publicly flogged for supposed breaches of sharia law, women were banned from going to market, and girls were stopped from going to school.

But it was only after the shooting, and a subsequent near-miraculous recovery, that she became a truly global figure.

She opened a Twitter account on her last day of school in July 2017 and now has more than a million followers.

"I know that millions of girls around the world are out of school and may never get the opportunity to complete their education," Malala wrote at the time.

During a recent appearance at the World Economic Forum in Davos, the feminist campaigner urged women to "change the world" without waiting for the help of men.

"We won't ask men to change the world, we're going to do it ourselves," Malala said.

"We're going to stand up for ourselves, we're going to raise our voices and we're going to change the world."