The man who the authorities say set off powerful bombs in Manhattan and on the Jersey Shore over the weekend planned the attacks for months, conducted a dry run just days before unleashing his assault and took inspiration from “Brother Osama bin Laden” and other international terrorists, according to a criminal complaint filed in federal court on Tuesday.

The man, Ahmad Khan Rahami, 28, was charged with several crimes, including use of weapons of mass destruction and bombing a place of public use, and the criminal complaint against him outlines how close the attacks came to causing death and even more destruction.

The bomb in Manhattan’s Chelsea neighborhood on Saturday night was powerful enough to vault a heavy steel Dumpster more than 120 feet through the air, according to the complaint. Windows shattered 400 feet from where the explosion went off, and pieces of the bomb were recovered 650 feet away. Among the 31 victims — two more than first reported — one had to have multiple ball bearings removed from her body as well as bits of metal from an ear and wood shards from her neck, the complaint says.

The charges came on a day when it was revealed that Mr. Rahami’s father told the authorities two years ago that he feared his son was a terrorist, prompting a review by the Federal Bureau of Investigation that did not find any basis for a fuller inquiry.