In a post to Twitter, Cook acknowledged Yousafzai's visit, which took place at Apple Park's Steve Jobs Theater.

"'If you stand for truth, you cannot lose.' Honored to host @Malala at Apple Park today with @lisapjackson. We are proud of the work Apple is doing with @MalalaFund to advance girls' education around the world," Cook said.

A photo accompanying the tweet shows Yousafzai, Cook and Jackson posing for a selfie.

Yousafzai also mentioned the visit on Twitter, saying she traveled to Cupertino with her family. The advocate thanked Cook and Apple for a "warm welcome, friendship and support."

Apple first teamed up with Yousafzai's Malala Fund in January to help expand the initiative's goal of providing safe, accessible education to girls living in war- and poverty-stricken countries.

Apple expected its contributions to double the number of grants provided by the fund's Gulmakai Network and expand funding programs to India and Latin America. An initial goal was to extend secondary education opportunities to more than 100,000 girls in those regions.

More recently, Apple in July announced an expansion to the initiative that involves the company's Brazilian Developer Academies. The new push challenges students and alumni to create apps that "enhance education opportunities for girls."