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 his assault and took inspiration from 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.
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 Mr. 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, N.J., early on 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, Mr. 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.”
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, Mr. Rahami writes of “killing the kuffar,” or unbelievers. Mr. Rahami also praises other terrorists, including Anwar al-Awlaki, Al Qaeda’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 Qaeda.
The complaint also cites evidence of Mr. Rahami’s preparations for the attacks, with some of the equipment 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, N.J.
The lighting of a fuse, the complaint says, is followed by “billowing smoke and laughter,” before Mr. Rahami is seen entering the frame and picking up the device.
As detailed as it is, the complaint leaves unanswered questions about when Mr. 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 Mr. Rahami two years ago, when his father shared with them his concerns that his son might be involved in terrorism.
The Federal Bureau of Investigation, which had been notified about Mr. 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.
Document: Federal Charges Against Ahmad Rahami
In some of the most high-profile terrorism-related cases in recent years — in Orlando, Fla.; San Bernardino, Calif.; 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 Mr. Rahami, the F.B.I. 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 is not clear if the bureau is going to take a second look at the Rahami investigation.
Investigators are still working to determine if Mr. Rahami had any outside assistance, if anyone knew of his plot, if he was aided in constructing the bombs and why he chose the targets that he did.
One key area of the investigation involves whether Mr. Rahami had help building the bombs or if anyone knew what he was doing and failed to report it. In all, he is linked to 10 explosive devices found in the region.
Among those Mr. Rahami praises in his notebook, according the complaint, is Mr. Awlaki, who remains a powerful influence on would-be jihadists, especially in the English-speaking West. Among his 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 Qaeda vary widely in when or if they claim credit.
The authorities are scrutinizing a number of trips Mr. 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 the New York City police.
His wife, who left the country days before the bombing, is currently in the United Arab Emirates, where she provided a statement to the F.B.I., according to officials.
The authorities are working to bring her back into the country as soon as possible.
The F.B.I. still believes that Mr. Rahami acted alone but is trying to speak with everyone who knew him.
It was unclear when Mr. 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.
He was still in Pakistan when he emailed Representative Albio Sires, Democrat of New Jersey, asking for help getting her a visa, according to the congressman.
Ms. Rahami’s Pakistani passport had expired, and agents at the United States Embassy in Islamabad discovered that she was 35 weeks pregnant, Mr. Sires said. Ms. Rahami was told that she would need to wait until her baby was born so she could apply for United States visas for both her and her child.
She eventually made it into the United States.
It was unclear when her visa issue was resolved. But in August 2014, Mr. Rahami got into a fight with his family, during which he stabbed his brother in the leg with a knife, according to court records.
The police arrived to investigate, and it was at this time that Mr. 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 Federal Bureau of Investigation in Newark. Officers opened what is known as an assessment, the most basic of F.B.I. investigations, and interviewed the father multiple times.
Ahmad Khan Rahami, 28, the suspect in a bombing in the Chelsea neighborhood of Manhattan that injured 29 people Saturday night, was arrested in Linden, N.J.
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 F.B.I. about his concerns his son was going through a difficult period.
“Two years ago I go to the F.B.I. because my son was doing really bad, O.K.?” he said. “But they check almost two months, they say, ‘He’s O.K., he’s clean, he’s not a terrorist.’ I say O.K.”
He added: “Now they say he is a terrorist. I say O.K.”
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 Mr. Rahami is illustrative of the challenges the F.B.I. 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 Mr. Rahami, one of the Boston bombers, Tamerlan Tsarnaev, was also the subject of an assessment in 2011.
And just was with Mr. Rahami, the F.B.I. 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.
Mr. 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 Qaeda. During the 10-month investigation, Mr. Mateen was interviewed twice, his calls were monitored and the F.B.I. 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 Mr. 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 Mr. Rahami.
Mr. Rahami remained in the hospital on Tuesday, recovering from surgery for gunshot wounds he sustained during the firefight with the police.