A former U.S. Marine and expert marksman was charged Friday in a foiled ISIS-inspired attack planned for Christmas on San Francisco's Pier 39, according to federal court documents.

Everitt Aaron Jameson, a Muslim convert living in Modesto, Calif., cited President Trump's decision to name Jerusalem the capital of Israel as one of his reasons behind the plot on the famed pier, which the FBI says would have included explosives and guns.

Jameson first attracted FBI attention after the agency received a tip that he'd been interacting with Facebook posts praising the Islamic State, including one showing an image of Santa Claus in New York and a box of dynamite with the words, "We meet at Christmas in New York...soon," a federal affidavit states.

An undercover FBI agent talked with Jameson over the Internet. They eventually met in person and talked about Jameson possibly traveling overseas to fight for ISIS or initiating an attack in the U.S., a criminal complaint states.

More:U.N. General Assembly repudiates Trump on Jerusalem decision despite his threat of U.S. aid cutoff

More:Backlash, protests continue over Trump's Jerusalem decision

Court documents show Jameson told the undercover agent he was "well versed" in the Anarchist Cookbook, a book detailing the construction of explosives.

The agent told him "to go home and think about what he was saying," the documents say, but Jameson instead said he was ready and wanted to do something similar to recent attacks in New York and San Bernardino, Calif.

Jameson told the agent he wanted to place explosives on Pier 39 and use them to corral people toward a location where he could continue killing. He said Christmas at the tourist attraction "was the perfect day to commit the attack," according to the federal court documents.

He said he didn't need an escape plan because he "was ready to die," the affidavit states.

The agent asked, according to the complaint, whether he could help get any supplies for Jameson, to which he replied that he'd need a rifle, ammunition, powder, tubing, nails and remote detonators.

Two days after their meeting, an FBI employee "mistakenly" called Jameson using a Washington, D.C., phone number but hung up when Jameson answered the phone in Arabic.

Jameson called back and got the employee's voicemail, federal court documents show.

Later that night, according to his arrest report, Jameson told the undercover agent he couldn't talk and "I also don't think I can do this after all. I've reconsidered."

Jameson was then arrested and the FBI got search warrants for his home.

Jameson left behind a signed letter citing Trump's decision to name Jerusalem the capital of Israel as one of his reasons behind the planned attack, court documents state.

Jameson also wrote, "long live ISIL" and said others will continue to attack because "we have penetrated and infiltrated your disgusting country."

Trump's Jerusalem decision, which led to violence and several deaths across the Middle East, was repudiated by the United Nations Thursday. The U.N. instead called for the future of Jerusalem to be decided through negotiations between Israel and Palestine, which also sees the city as its capital.

Authorities found three firearms and ammunition in his home, court records show.

Jameson faces a charge of attempting to provide material support to a foreign terrorist organization.

Follow Christal Hayes on Twitter: @Journo_Christal