The FBI has said it found a martyrdom letter and several guns in the home of a former marine who said he wanted to carry out a Christmas Day attack on a popular San Francisco tourist destination.
Everitt Aaron Jameson, 26, a Modesto tow-truck driver, was charged with attempting to provide material support to a foreign terrorist organisation.
Jameson told an undercover agent who he believed to be associated with senior leadership of the Islamic State group that he wanted to conduct a violent attack on Pier 39 in San Francisco because it was heavily crowded, according to an FBI affidavit.
He told the undercover agent that Christmas Day would be "the perfect day to commit the attack" and that he "did not need an escape plan because he was ready to die", according to the affidavit.
Pier 39, packed with restaurants, bars and souvenir shops, is one of San Francisco’s most popular tourist spots.
Home to the city’s aquarium, the pier offers free live music and street performances and offers a good spot to photograph sea lions that gather in the marina below.
He was under surveillance and "the public was never in imminent danger", FBI spokeswoman Katherine Zackel said in a statement.
She and San Francisco acting mayor London Breed both said there are no other known threats, though police increased their presence throughout the city after being notified of the FBI investigation several days ago.
"San Francisco is a city that proudly champions democracy, freedom and liberty. Sadly, that makes our home a target," Ms Breed said in a statement.
"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 had posted radical jihadist messages online, including expressing support for the Halloween terror attack in New York City in which a driver used his truck to kill eight people, the FBI said.
Jameson offered to use his tow truck to support the cause, the affidavit says.
The FBI began investigating in mid-September when it learned that Jameson was expressing support for posts that favoured terrorism or IS.
He "loved" an online post that showed Santa Claus threatening an attack in New York with a box of dynamite, it said.
Agents raided his home on Wednesday, finding a martyr’s letter signed with an Islamic variation of his name, along with his last will and testament updated in November, the affidavit says.
They also found fireworks, two rifles and a 9mm handgun, the FBI said.
During the search, 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", the affidavit says.
He was arrested on Friday and faces up to 20 years in prison if convicted.
Jameson had attended marine basic recruit training in 2009 and earned a sharpshooter rifle qualification.
He was discharged for failing to disclose a history of asthma, the affidavit said.
He referred to his military service in comments to undercover agents.
"I have been trained in combat and things of war," Jameson told one agent.
Jameson made a pledge to the Muslim faith two years ago at an Islamic centre in Merced, according to the affidavit.
"The threat from radical Islamic terrorism is real - and it is serious," attorney general Jeff Sessions said in a statement, but federal agents are protecting the nation from what he called "an alleged plot to kill Americans".