As a college student in Pakistan, she was known as a "Saudi girl," her face shrouded in a black veil in the conservative style typical of women in the Persian Gulf kingdom where she spent most of her childhood.
But growing up in Riyadh, Saudi Arabia's oil-rich and sometimes turbulent capital, Tashfeen Malik lived the life of a Pakistani girl, part of a large but often isolated guest worker community acutely aware of its outsider and second-class status.
Years before she and her husband killed 14 people in a torrent of gunfire inside the Inland Regional Center in San Bernardino, Malik straddled two very different countries and her identity spanned two worlds.
She was a brilliant and diligent student who traded school gossip and spoke of plans for a career in pharmacology. At the same time, she was quietly becoming an increasingly orthodox Muslim who shunned male classmates, urged her female relatives to be more religious and, in private Facebook messages, expressed a desire to take part in violent jihad.
Those who knew Malik, who was 29, are still struggling to understand what drove her and her husband to leave their 6-month-old child with relatives on Dec. 2 to don military gear and open fire on dozens of county government employees enjoying a holiday party.
Her family members in Saudi Arabia, who have given only limited statements to the media because they are afraid Saudi officials will revoke their guest worker status, say they are devastated and confused. At her university in Pakistan, former classmates say she had no close friends, but never gave signs that her religious studies were leading toward extremism.
What is clearer is that Malik grew up amid strict social constraints in politically charged lands. A teenager in Saudi Arabia at the height of Al Qaeda's terrorism campaign against the country, she probably lived in the isolation typical of most expatriates here, particularly women. She left her parents and returned to Pakistan around 2005, barely into adulthood, as that country was gripped by rising anti-American sentiment and extremist violence.
Born in Karor Lal Esan, in a region of wheat and rice fields in Pakistan's Punjab province, Malik moved to Saudi Arabia as a child after her father found work as an engineer there. She was, according to her brother and former high school teachers, a gifted and obedient student who stood out for her high marks but little else.
"She was the top of the class, always," said her brother, Saad Malik. He said he and his family members are struggling to understand how Tashfeen became a radicalized killer in the faraway suburbs of California, where she'd moved with her new husband.
"We don't have any idea about what happened over there."
The Malik family's path from the fertile fields of Pakistan to the sand-blown Saudi kingdom was not unique. Pakistani laborers have been making the journey since the discovery of vast oil reserves in the Persian Gulf almost a century ago. Of the 28 million people now living in Saudi Arabia, more than 2 million are Pakistanis.
Malik's father, Gulzar, came to Riyadh in the early 1980s to work at a Saudi construction company. He was joined several years later by his wife, three sons and three daughters.
Relatives in Pakistan have said Gulzar appeared to become more religiously conservative and embrace more radical political beliefs while living in the kingdom. But Saudi officials say the engineer and his family never registered as a security threat.
"We are very careful who we allow to come to Saudi Arabia and who we allow to stay here because we are threatened by terrorism," said Mansour Sultan al-Turki, a spokesman for the Saudi Interior Ministry. "There was nothing at all to suspect any of them."
Malik studied at the Pakistan International School from grades nine through 12, around 2002 to 2005, according to the Pakistani Embassy in Riyadh, which oversees the coed school of 10,000 students.
With classes in Urdu, instead of Arabic, and a curriculum based on the one back home in Pakistan instead of the Saudi system, the sprawling walled campus is something of a bubble, its administrators say. Students can choose from among three tracks — arts, pre-engineering or pre-medical, said Rahir Raza Abid, the school's principal. Malik was on the math- and science-heavy pre-med track, and she flourished.
"She was a brilliant student," Abid said.
But like all foreign nationals who come to Saudi Arabia from countries with few job opportunities, Pakistanis often live under strict controls, enjoying fewer freedoms and a poorer lifestyle than the Saudis who hire them. Even those in higher-paying jobs usually live in their own neighborhoods, study at their own schools and rarely mix socially with Saudi society.
"They could grow up here for years without ever meeting a Saudi, without ever having a Saudi friend," said Khaled Almaeena, a former editor in chief of both of the country's major English-language newspapers. "Some Americans are racist. We Saudis are double racist."
The alienation can be especially acute for foreign women, who must adhere to the nation's strict Islamic laws governing women's dress, behavior and freedom of movement.
Barred from driving or socializing in places where there are men, they face lashes from the religious police if spotted without a long black cloak. Many families expect their women to wear the niqab, a black covering over the head and face with only a small slit for the eyes.
"Sometimes we feel isolated," said Mehreen Zulfiqar, 35, a Pakistani living in Saudi Arabia with her engineer husband. He spends most of his time at work, she said, which means she rarely leaves the house.
The couple and their children were eating lunch at a Pakistani restaurant in downtown Riyadh — not far from the apartment that Malik and her family had shared — seated behind a partition designed to block women from public view.
"Everything is different here," said her husband, Shoabi, 39. "The food, the gender separation. We are not mixing with Saudis. Their culture is different. We can't. We don't send our children to Arabic schools because we know one day we have to go back to Pakistan."
Many Pakistanis embrace Saudi Arabia's more conservative culture, which is shaped by Wahhabism, a strict branch of Sunni Islam. At the private Pakistani school Malik attended, female students are taught on a separate campus and cannot leave at the end of the day without a male family escort.
Nisma Rafiq, a Saudi-born woman of Pakistani origin who attended the same high school as Malik, said going home can be challenging. She faced taunts when she went to Pakistan for college, she said.
"We go to Pakistan and they call us 'Saudi girls,'" she said. "You are judged by your family. They say you're not the same."
Malik graduated and returned to Pakistan around 2005, Abid said. Family members who greeted her in Punjab saw a young woman clearly changed.
Although relatives in Karor Lal Esan had remembered her as a "modern girl," she now covered her face in a veil. She spoke Arabic — unlike many Pakistani expatriates — and occasionally would have conversations in Arabic online late at night, one relative said.
In 2007, Malik enrolled in the pharmacology program at Bahauddin Zakariya University, one of the most competitive in Punjab. Located in Multan, a bustling city renowned for its Sufi shrines, the private institution bills itself as "a progressive university." Many female faculty members don't cover their hair. In the pharmacology program that included several hundred female students, Malik was in a minority of about 10% who wore a veil, a professor recalled.
"I never knew what she looked like," said Nazar Mohammad Ranjha, a lecturer who taught Malik in 2007. "The first time I saw her face was on CNN."
She lived at a house her father owned in Multan's Babar Colony, a neighborhood of law offices and single-family homes. On campus, she studiously avoided contact with male students and had few close friends, classmates said. But that did not stop her from taking note of romantic relationships among her peers.
When classmates discussed fashion and boys, she chimed in with the latest gossip in her familiar loud, nasal voice, said one female student who knew her.
"We used to discuss our classmates' love affairs, and she had more information than any of us," said the student, who did not want to be named discussing Malik. "She used to laugh loudly. We used to make fun of her voice, but she never complained about it."
In the department, "everyone knew she was from Saudi Arabia," said a professor, Nisar Hussain.
"She was religious, but a very normal person as well," Hussain said. "She was a very hardworking and submissive student."
In her spare time, she was throwing herself deeper and deeper into conservative Islam.
Multan, now a city of 3 million in southern Punjab, is known for towering, blue-tiled shrines to saints of Sufism, a mystical Islamic order that eschews violence. But in recent decades, the city and surrounding province, the most populous in Pakistan, have seen the growing influence of conservative Islamic schools, known as madrassas, and militant organizations.
In mid-2013, alongside her pharmacology studies, Malik began attending classes at Al Huda, a chain of modern madrassas that cater to upper-class urban women. Classmates said she was there almost every day, although she didn't discuss what she was learning.
The institute teaches a deeply conservative strain of Islam, preaching that wives should obey their husbands. Al Huda's founder, Farhat Hashmi, promotes anti-Western conspiracy theories and has argued that Osama bin Laden was "a warrior."
Many students bring the institute's teachings home with them, intending to indoctrinate other women in their family, analysts say. A relative of Malik's in Karor Lal Esan, who asked not to be identified, said that toward the end of her university days, Malik "started asking women in the family and the locality to become good Muslims."
From 2011 to early 2013, protests frequently erupted in Multan over U.S. drone strikes in Pakistan's tribal belt, with demonstrators setting fire to likenesses of the American flag.
In March 2013, while Malik was a student at the university, Junaid Hafeez, a lecturer in the English department, was accused of making derogatory remarks about the prophet Muhammad. Hafeez was jailed on blasphemy charges, and a year later, two men walked into his lawyer's office in Multan and shot and killed him.
"The university does have a liberal leaning, which makes one believe that any extremist influence on Malik — religious or otherwise — may have taken place before or on the side of her university studies," said Fahd Humayun, research manager at the nonprofit Jinnah Institute think tank in Islamabad, the Pakistani capital.
But Pakistan was growing more unstable while Malik was there, Humayun said, "and Multan is not an exception."
Saudi officials say immigration records show Malik visited from Pakistan in July 2008 and again in 2013. On the second trip, Saudi officials say, her stay in the country overlapped for about six days with that of Syed Rizwan Farook, a U.S. citizen of Pakistani descent who was there on hajj, the annual Muslim pilgrimage to Mecca. The following year, she would join Farook in the United States.
She would become his wife, the mother of his child, his partner in death.
Bengali reported from Mumbai, India, and Linthicum from Riyadh. Special correspondent Aoun Sahi in Islamabad, Pakistan, contributed to this report.
MORE ON THE SAN BERNARDINO TERROR ATTACK