OAKLAND — A man is facing federal charges after a California Highway Patrol officer discovered an “explosive device” containing 47 nails that was inscribed with a swastika and a menacing note, federal prosecutors said.

Pablo G. Nalerio was charged with receiving or possessing a firearm not registered in the National Firearms Registration and Transfer Record, according to a criminal complaint unsealed Wednesday.

Nalerio was arrested Aug. 30, after a California Highway Patrol officer pulled him over on I-880 in Oakland, driving a stolen motorcycle, the complaint says. Nalerio was allegedly found with a small bag of methamphetamine and told the officer he had “dumb (expletive) fireworks we’re going to blow up at my friend’s farm this weekend.”

The officer found one “explosive device” that appeared to be three four-inch mortars taped together. A bomb squad from the UC Berkeley police department was called to the scene and found 47 nails, each two inches long, taped to the inside.

On the outside of the device, someone had drawn a swastika as well as a note that said, “You dead as (expletive),” the complaint alleges.

When asked to explain the device, Nalerio allegedly told police: “Yeah I know how (expletive) that looks but we’re gonna like blow it up inside a refrigerator or something, but I understand that that’s really dumb.”