NEW YORK — The man who 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 his assault and took inspiration from Osama bin Laden and other international terrorists, according to a criminal complaint filed in federal court 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.

According to the complaint, the bomb in Manhattan's Chelsea neighborhood on Saturday night was powerful enough to vault a dumpster around 120 feet through the air. Windows shattered 400 feet from where the explosion went off, and pieces of the bomb were recovered 650 feet away.

The complaint offers evidence that Rahami was motivated by an extremist Islamic ideology that he recorded in a notebook he had with him when he was shot and wounded by the police in Linden, New Jersey, early Monday and then taken into custody.

Pierced by a bullet and splattered with blood, the journal contains screeds against the wars in Iraq and Afghanistan.

In one handwritten message, according to the complaint, Rahami pleads that he not be caught before carrying out his planned attacks.

"My heart I pray to the beautiful wise ALLAH," he wrote. "To not take JIHAD away from. I beg."

A still image captured from a video from WABC television shows bombing suspect Ahmad Khan Rahami being loaded into an ambulance Monday after a shoot-out with police. Courtesy WABC-TV via REUTERS
A still image captured from a video from WABC television shows bombing suspect Ahmad Khan Rahami being loaded into an ambulance Monday after a shoot-out with police. Courtesy WABC-TV via REUTERS

Elsewhere in the notebook, the complaint says, he refers to pipe bombs and pressure cookers as well as to shooting police officers.

In one section, Rahami writes of "killing the kuffar," or unbelievers. Rahami also praises other terrorists, including Anwar al-Awlaki, al-Qaida's leading propagandist, who died in a drone strike in Yemen, as well as the soldier in the Fort Hood shooting, among the deadliest of the so-called lone wolf attacks inspired by al-Qaida.

The complaint also cites evidence of Rahami's preparations for the attacks, with some of the equipment he used bought on eBay. Two days before the bombing in Chelsea, according to the complaint, he recorded video of himself igniting an incendiary device in the backyard of his home in Elizabeth, New Jersey.

The lighting of a fuse, the complaint says, is followed by "billowing smoke and laughter," before Rahami is seen entering the frame and picking up the device.

As detailed as it is, the complaint leaves unanswered questions about when Rahami began to feel deep antipathy for the country he had lived in for years and where he had become a naturalized citizen.

Federal agents first became aware of Rahami two years ago, when his father shared with them his concerns that his son might be involved in terrorism.

The FBI, which had been notified about Rahami by the local police after a domestic dispute involving the family, said in a statement that it checked its databases, contacted other agencies and conducted interviews. But the agency's review did not turn up anything that warranted further inquiry, and the review was closed.

In some of the most high-profile terrorism-related cases in recent years — in Orlando, Florida; San Bernardino, California; and Boston — federal authorities had looked into a suspect's life long before they launched their assaults.

Each of the cases is different, and in the case of Rahami, the FBI has so far found no evidence of links to terrorist organizations.

The agency's director, James B. Comey, has previously defended how those cases were handled but promised a review of what happened. It was not clear if the bureau was going to take a second look at the Rahami investigation.

Investigators were still working to determine if Rahami had any outside assistance, if anyone knew of his plot and if he was aided in constructing the bombs. They were also trying to determine why he chose the targets that he did.

In all, Rahami is linked to 10 explosive devices found in the region.

Law enforcement officers search the Rahami restaurant in New Jersey on Monda. REUTERS/Eduardo Munoz
Law enforcement officers search the Rahami restaurant in New Jersey on Monda. REUTERS/Eduardo Munoz

Among those Rahami praises in his notebook, according the complaint, is al-Awlaki, who remains a powerful influence on would-be jihadis, especially in the English-speaking West. Among al-Awlaki's documented admirers were Syed Rizwan Farook, who along with his wife killed 14 people in San Bernardino; Omar Mateen, who fatally shot 49 people in an Orlando nightclub; and Tamerlan and Dzhokhar Tsarnaev, who staged an attack at the finish line of the Boston Marathon with pressure-cooker bombs in 2013.

No terrorist organization has claimed responsibility for the attack. While the Islamic State is usually quick to claim credit for attacks around the world, organizations linked to al-Qaida vary widely in when or if they claim credit.

Authorities are scrutinizing a number of trips Rahami made overseas, particularly several to Pakistan. In May 2011, he made a three-month trip to Quetta, according to law enforcement officials, citing Customs and Border Protection records. Then, in April 2013, he made another trip to Quetta and did not return until March 2014, according to information provided to federal customs authorities by New York City police.

His wife, who left the country days before the bombing, is in the United Arab Emirates, where she provided a statement to the FBI, according to officials. Authorities are working to bring her back into the country as soon as possible.

The FBI still believes that Rahami acted alone but is trying to speak with everyone who knew him.

It was unclear when Rahami married his wife, Asia, but after returning from a nearly yearlong visit to Pakistan in March 2014, he was increasingly desperate to get her into the country.

She eventually made it into the United States.

It was unclear when her visa issue was resolved. But in August 2014, Rahami got into a fight with his family, during which he stabbed his brother in the leg with a knife, according to court records.

Police arrived to investigate, and it was at this time that Rahami's father told them about his concerns about his son's possible involvement in terrorism. The information was passed to the Joint Terrorism Task Force led by the FBI in Newark, New Jersey. Officers opened what is known as an assessment, the most basic of FBI investigations, and interviewed the father multiple times.

They never interviewed the son, who was in jail at the time, according to the official.

The father, Mohammad Rahami, in a brief interview, said that at the time he told agents from the FBI about his concerns his son was going through a difficult period.

"Two years ago I go to the FBI because my son was doing really bad, OK?" he said. "But they check almost two months, they say, 'He's OK, he's clean, he's not a terrorist.' I say OK."

He added: "Now they say he is a terrorist. I say OK."

An official familiar with the inquiry said that the father, after making his initial comments about his son, recanted and said he spoke out of anger. He said his son was spending time with "bad" people, meaning criminals.

The assessment of Rahami is illustrative of the challenges the FBI faces as it solicits information from the public about people who might pose a threat but then has to sort through what is credible and what is not, all while balancing the need to protect the country while not overstepping its authority.

Depending on the urgency, there are three different types of investigations they can undertake with varying levels of intrusive techniques.

The first is an assessment, where agents use basic techniques like conducting interviews and checking databases and public records.

The next level of inquiry is a preliminary investigation, which can be initiated on the basis of any information that is indicative of possible criminal or national-security threatening information, can include tools like recording calls and using confidential informants.

Both assessments and preliminary inquiries have time limits.

However a full investigation, which requires a more substantial factual prediction to launch, has no such time limits and employs powerful physical and electronic surveillance tools, often requiring the approval of a secret court warrant. Among other things, it allows for the interception of international communications.

Like Rahami, one of the Boston bombers, Tamerlan Tsarnaev, was also the subject of an assessment in 2011. And just as with Rahami, the FBI did not generate any additional leads that would have prompted a more serious investigation. The Tsarnaev assessment was one of approximately 1,000 the Joint Terrorism Task Force in Boston carried out that year.

In the Orlando nightclub attack this year, the circumstances were different.

Mateen, who carried out the deadly assault, had made highly inflammatory comments, which came to the attention of investigators, raising the profile of his case to a preliminary inquiry. He told colleagues that he had relatives in terrorist organizations such as al-Qaida. During the 10-month investigation, Mateen was interviewed twice, his calls were monitored and the FBI used confidential informers.

But still, the bureau found no evidence that his statements were credible or that he had ties to terrorism.

While the federal assessment of Rahami was closed weeks after it began, he did face criminal charges of aggravated assault and illegal weapons possession stemming from the domestic dispute, according to court records. He spent over three months in jail, according to a law enforcement official with knowledge of the investigation. A grand jury, however, declined to indict Rahami.

Rahami remained in the hospital Tuesday, recovering from surgery for gunshot wounds he sustained during the firefight with police.

Reporting was contributed by Rukmini Callimachi, Elizabeth A. Harris, Sarah Maslin Nir, Julia Preston, William K. Rashbaum, Eli Rosenberg, Nate Schweber, Scott Shane and Benjamin Weiser.