Bernandino Bolatete, a Filipino immigrant to the US, planned to target the Islamic Center of Northeast Florida in Jacksonville, says the FBI.
“I just want to give these freaking people a taste of their own medicine,” he allegedly texted an undercover officer.
At a press conference on Monday, Jacksonville Sheriff Mike Williams said Mr Bolatete “had expressed a strong anti-Islamic sentiment” and “had weaponry to carry out the attack”.
The FBI say Mr Bolatete, who suffered from kidney problems, told an undercover agent he wanted to “shoot up” a mosque before he died.
“We have no idea as to what was the motivation this individual had for his planned heinous act,” said spokesman M Ashraf Shaikh.