– A 26-year-old tow truck driver from Modesto, Calif., was accused Friday of planning an ISIS-inspired terror attack over the holidays on San Francisco's Pier 39 — a plot that unraveled when his would-be partners turned out to be undercover FBI agents.

Everitt Aaron Jameson, a onetime high-school wrestler who converted to Islam after being discharged from the Marines and losing custody of his two children, was charged in U.S. District Court in ­Sacramento with attempting to provide material support to a foreign terrorist ­organization.

The FBI arrested Jameson on Wednesday while raiding his home, where agents reported finding an envelope containing a handwritten letter, dated Dec. 16, confessing he had "committed these acts upon the Kuffar," using a derogatory term for non-Muslims. The agents said a second envelope held Jameson's "last will and testament."

"You have brought this upon yourselves," the letter stated, according to an FBI affidavit. "We have penetrated and infiltrated your disgusting country."

Two rifles, a pistol, ammunition and fireworks were also seized in the home. During interviews with the FBI after being arrested, Jameson "stated his support of ISIS and terrorism and discussed aspects of the plan to carry out an attack, noting that he would be happy if an attack was carried out," FBI Agent Christopher McKinney wrote in the affidavit.

"Jameson has espoused radical jihadi beliefs, including authoring social media posts that are supportive of terrorism, communicating with people he believes share his jihadi views and offering to provide services to such people, including in the form of his presumably employer-provided tow truck in service of the 'cause,' " McKinney wrote, explaining the charge.

Jameson named Pier 39 as a possible target for a terrorist attack because he "knew that it was a heavily crowded area," and said "Christmas was the perfect day to commit the attack," according to the ­complaint.

Family members of Jameson said Friday they were shocked to learn of the arrest. He was once arrested for petty theft and sued for child support, court records show, but had no known history of violence.

"My heart hurts, it really does," Jameson's father, Gordon Jameson, told Fresno TV station KFSN. "It kills me to know that he would do something like that. That's not how he was raised."

Mitch Myers, who lived next door to Everitt Jameson in Modesto until Jameson moved about a year ago, described him as quiet and friendly. Sometimes the two men would wave at each other while doing yard work.

"That must have been before the ISIS thing," Myers said.

San Francisco police officials were notified about the investigation in recent days and said they increased the presence of officers throughout the city.

"San Francisco is a city that proudly champions democracy, freedom and liberty. Sadly, that makes our home a target," said acting Mayor London Breed. "We will not allow the thwarted attempts of one dangerous individual to disrupt our way of life. We will remain vigilant and continue to protect our city from any threat."

Jameson was discharged from the U.S. Marine Corps for fraudulent enlistment after it was discovered he failed to disclose a latent asthma history, the FBI said. In June 2009, while in the Marines, he earned a sharpshooter rifle qualification, McKinney wrote.

Jameson's public Facebook page reveals a devout Muslim who recently posted about President Donald Trump's decision to declare Jerusalem the capital of Israel.

"Jerusalem is the capital of Palestine," he wrote beneath a selfie, showing him wearing a traditional Muslim cap.

Another post reads, "If my words threaten those in power, so be it. If my pictures alarm the people, that is good. Your teeth come down. my sword goes up. I am not afraid."

If convicted, Jameson faces up to 20 years in prison.

The FBI was tipped off to Jameson on Sept. 19 when an unnamed confidential source who had "accurately reported to the FBI on national security matters in the past" reported suspicious posts on Jameson's Facebook account, according to the complaint. The source was ultimately paid $2,600 for his work on the case.