The FBI has said Farook and Malik were radicalized before they met online in 2013, but the court documents detail how much earlier Farook had turned down that path to plot violence.
Marquez said he and Farook aborted their plans after authorities interrupted a terror plot in the area in November 2012 that involved four men who wanted to join either the Taliban or al-Qaida fighting U.S. forces overseas.
He said they didn't see much of each other after that unraveled, though he deepened his connection with the Farook family, which also led to an immigration fraud charge against him.
Both men were witnesses at the wedding of Farook's brother, Raheel, to a Russian woman in 2011, according to Riverside County marriage records.
Last year, Marquez married the sister of Raheel Farook's wife. Prosecutors said it was a sham marriage to help the Russian woman obtain U.S. residency. According to the affidavit accompanying the charges, Marquez was paid $200 per month for the union and said his own mother and brother didn't know about it.
About a month before the attack, Marquez made a reference to the marriage and living "multiple lives" in a chat with a fellow Facebook user that foreshadowed the trouble he was facing before any bullets started flying.
"Involved in terrorist plots, drugs, anti-social behavior, marriage, might go to prison for fraud, etc," according to the affidavit by FBI agent Joel Anderson.
Right after the shooting, Marquez called his mother to say he was safe but that he wouldn't be coming home, neighbor Lorena Aguirre said.
When she visited him in the hospital two days later, he again referred to Syed Rizwan Farook by an expletive and said he did not know "he was going to do that," Anderson said in the affidavit. Marquez also said he no longer wanted Farook as a friend.
The next day, federal agents raided his mother's house in Riverside, a city near San Bernardino that is about 60 miles east of Los Angeles.
Armida Chacon has said her son is a good person who loved to hang out with friends and go to parties.
"I don't know how this happened," she told The Los Angeles Times. "My world is upside-down."
Marquez's friends were shocked to learn he was linked to the attack and described him as a friendly, easygoing guy who was not religious and rarely discussed his family or marriage.
"I still can't believe this is going on," said Viviana Ramirez, who met Marquez through an online forum when they studied at Riverside Community College. "I just want people to know he's not a bad person."
Marquez was a licensed security guard for several years, but his license expired at the end of 2014. He was providing security at the bar where he worked until Dec. 2.
He posted a cryptic note that day on Facebook, according to the affidavit: "It was a pleasure knowing everyone."