Quick: what was the first major terrorist attack by a foreign power on the United States?
If you answered an ingenious German plot in 1916 to blow up a major weapons depot in New York Harbor, you win a prize.

However, I am guessing that you didn’t come up with that answer. But it is a story worth knowing. It’s got spies, heroic rescue efforts, a pencil bomb, and an investigation that took years, and Smithsonian’s awesome Past Imperfect blog has the details:
All was dark and quiet on Black Tom Island in New York Harbor, not far from the Statue of Liberty, when small fires began to burn on the night of July 30, 1916. Some guards on the island sent for the Jersey City Fire Department, but others fled as quickly as they could, and for good reason: Black Tom was a major munitions depot, with several large “powder piers.” That night, Johnson Barge No. 17 was packed with 50 tons of TNT, and 69 railroad freight cars were storing more than a thousand tons of ammunition, all awaiting shipment to Britain and France. Despite America’s claim of neutrality in World War I, it was no secret that the United States was selling massive quantities of munitions to the British.
The guards who fled had the right idea. Just after 2:00 a.m., an explosion lit the skies—the equivalent of an earthquake measuring up to 5.5 on the Richter scale, according to a recent study. A series of blasts were heard and felt some 90 miles in every direction, even as far as Philadelphia. Nearly everyone in Manhattan and Jersey City was jolted awake, and many were thrown from their beds. Even the heaviest plate-glass windows in Lower Manhattan and Brooklyn shattered, and falling shards of glass preceded a mist of ash from the fire that followed the explosion. Immigrants on nearby Ellis Island had to be evacuated.

The German masterminds of the attack are straight out of central casting:
One of those newcomers to America was Count Johann Von Bernstorff, the German ambassador to Washington. He arrived in 1914 with a staff not of diplomats, but of intelligence operatives, and with millions of dollars earmarked to aid German war efforts by any means necessary. Von Bernstorff not only helped obtain forged passports for Germans who wanted to elude the Allied blockade, he also funded gun-running efforts, the sinking of American ships bringing supplies to Britain, and choking off supplies of phenol, used in the manufacture of explosives, in a conspiracy known as the Great Phenol Plot.
One of his master spies was Franz Von Rintelen, who had a “pencil bomb” designed for his use. Pencil bombs were cigar-sized charges filled with acids placed in copper chambers; the acids would ultimately eat their way through the copper and mingle, creating intense, silent flames. If designed and placed properly, a pencil bomb could be timed to detonate days later, while ships and their cargo were at sea. Von Rintelen is believed to have attacked 36 ships, destroying millions of dollars worth of cargo. With generous cash bribes, Von Rintelen had little problem gaining access to piers—which is how Michael Kristoff, a Slovak immigrant living in Bayonne, New Jersey, is believed to have gotten to the Black Tom munitions depot in July of 1916.
Investigators later learned from Kristoff’s landlord that he kept odd hours and sometimes came home at night with filthy hands and clothing, smelling of fuel. Along with two German saboteurs, Lothar Witzke and Kurt Jahnke, Kristoff is believed to have set the incendiary devices that caused the mayhem on Black Tom.
Read the whole thing. It’s an incredible tale.