A small bomb exploded in a New Jersey beach town in New York City along the route of a planned road race on Saturday morning, causing no injuries but prompting authorities to cancel the event and evacuate dozens of homes as they searched for more devices.

No damage to surrounding structures was reported after the device went off in a garbage container ahead of a 5km charity race in Seaside Park, a resort about 150km south of New York City, the Ocean County prosecutor's office said on Facebook.

The explosion stirred memories of the deadly blasts at the finish line of the Boston Marathon in 2013. Credit:Reuters

Even so, the explosion stirred dark memories of the deadly blasts at the finish line of the Boston Marathon in 2013 that killed three people and wounded more than 260 others.

The charity run was organised to benefit military veterans and the families of those lost in military service. The run's name, Seaside Semper Five 5K, is a reference to Semper Fidelis, Latin for "always loyal," the motto of the US Marine Corps.