New Yorkers pass a shattered storefront window on W. 23rd St. in Manhattan, Tuesday, Sept. 20, 2016, in New York. The window was hit by shrapnel from the terrorist bomb that exploded across the street Saturday evening. An Afghan immigrant wanted in the bombings was captured Monday after being wounded in a gun battle with police. (AP Photo/Mark Lennihan)
New Yorkers pass a shattered storefront window on W. 23rd St. in Manhattan, Tuesday, Sept. 20, 2016, in New York. The window was hit by shrapnel from the terrorist bomb that exploded across the street Saturday evening. An Afghan immigrant wanted in the bombings was captured Monday after being wounded in a gun battle with police. (AP Photo/Mark Lennihan) Credit: Mark Lennihan

The FBI said on Tuesday that more than two years before the recent bombings in New York and New Jersey, agents had investigated the man accused of planting and setting off explosives.

Authorities began looking into Ahmad Khan Rahami, the 28-year-old named as the only suspect in the bombings, after receiving reports that his father said he was a terrorist, though officials said on Tuesday that his father later recanted the claim. Agents conducted interviews, checked with other agencies and looked at internal databases, โ€œnone of which revealed ties to terrorism,โ€ the bureau said in a statement.

The revelation was the second time this year โ€” and the fourth time since 2013 โ€” that the FBI acknowledged that it had investigated someone who later carried out what officials called an act of terror. Federal prosecutors on Tuesday charged Rahami, who remained hospitalized after a shootout with police, with four counts, including using weapons of mass destruction and bombing a public place, according to an FBI complaint.

Investigators are still trying to determine Rahamiโ€™s motives and whether he had any outside help. Since his capture in Linden, N.J., signs have emerged that Rahami was interested in extremist ideologies.

A handwritten journal found on Rahami after the shootout included a reference to Anwar al-Awlaki, an American-born cleric who was a top leader for al-Qaida in Yemen, according to a complaint filed Tuesday night in the U.S. District Court for the Southern District of New York.

The journal included notes that said that the FBI was looking for him and that he was praying to Allah โ€œto not take JIHAD away.โ€ This journal appeared to be damaged during the exchange of gunfire, the complaint said; law enforcement officials said it had blood on it.

In addition, the journal also included references to the Boston Marathon bombings, the 2009 Fort Hood shooting in Texas and โ€œBrother Osama Bin Laden.โ€ The papers did not apparently include any reference to the Islamic State, which claimed responsibility for mall stabbings over the weekend in Minnesota but has made no similar claim about the bombing.

A day after Rahami was captured by police, investigators continued to delve into his life and examined his friends, family, records, social media accounts and phones.

According to friends and court records, many aspects of Rahamiโ€™s life appeared to begin unraveling after he graduated from high school. As a high school senior in 2007, he got his girlfriend Maria pregnant, and she โ€œwas very pregnantโ€ by the senior prom, said Chris Konya, a high school classmate from New Jersey.

Rahamiโ€™s father, Mohammad, was angry about him dating her because she was Dominican and from a different race, said three people who knew him at the time. After graduation, Rahamiโ€™s father forced him to make a trip back to Afghanistan, even though he didnโ€™t want to go, said Imani Podhradsky, a classmate.

After their daughter was born, Ahmad Khan Rahami and his girlfriendโ€™s relationship appeared to be turbulent. Court documents show that she took him to court for not paying child support. On Tuesday, about 24 hours after Rahami was apprehended, she filed an application for full custody, pointing to his involvement in โ€œpossible terrorist related activityโ€ and the fact that he was charged with attempting to kill police officers.

In 2014, Rahami was accused of stabbing a family member in the leg, court records show. When Rahamiโ€™s father spoke briefly to a scrum of reporters Tuesday, he said that the younger man was violent toward other family members โ€œfor no reason.โ€

At some point, he married a Pakistani woman. Two years ago, Rahami had been living in Pakistan for a year when he contacted the office of Rep. Albio Sires, D-N.J. Rahami said he was having trouble getting his wife an immigrant visa. She was pregnant and able to get her visa only after the baby was born in Pakistan, Sires said.

Siresโ€™ office found out that at some point after this, Rahamiโ€™s wife got her visa, but the congressman doesnโ€™t know what happened after.

A Pakistani intelligence officer in Quetta said on Tuesday that an initial investigation showed he had visited Quetta, a hub for militant groups, in 2011 and 2013. The intelligence officer said there is evidence Rahami was married there.

According to two federal law enforcement officials, Rahamiโ€™s wife was overseas when the bombing occurred and heading back to the United States at the time. She was detained in the United Arab Emirates for questioning, officials said.

The references in Rahamiโ€™s note to bin Laden, Awlaki and attacks like the Boston Marathon bombing and the absence of any mention of the Islamic State raises the possibility he was inspired by al-Qaida, analysts said.

If anything, said Bruce Hoffman, a terrorism expert at Georgetown University, this may be โ€œan al-Qaida-inspired or al-Qaida-linked connection.โ€

Even after Awlaki was killed in a 2011 drone strike in Yemen, his rhetoric continues to resonate online. His teachings have been implicated in numerous terrorist attacks, including the Fort Hood shooting in 2009 and the Boston Marathon bombing in 2013. Authorities say the gunman in Orlando, Fla., earlier this year and one of the attackers in San Bernardino, Calif., last year had also viewed Awlakiโ€™s lectures.

Rahamiโ€™s travel to Afghanistan and Pakistan between 2011 and 2014, also raise questions about whether Rahami was in some fashion radicalized while he was in south Asia, a possibility investigators are looking into.

Rep. Adam Schiff, of California, ranking Democrat on the House Intelligence Committee, who has been briefed on the New York and New Jersey cases, said the current probe is โ€œreminiscentโ€ of the Boston Marathon case.

In 2013, two brothers planted pressure-cooker bombs packed with shrapnel near the marathonโ€™s finish line. Investigators did not initially know whether the brothers โ€” particularly the elder brother, who died in a confrontation with police โ€” had contact with foreign terrorist elements. They were interested in his travel and he had previously come to the attention of the FBI.

โ€œWe were looking into whether we had missed something,โ€ Schiff said in an interview. โ€œWeโ€™re asking all those same questions again.โ€

Schiff said that a takeaway from this is that even the best efforts from intelligence agencies and law enforcement โ€œcanโ€™t always catch people who mean to do us harm.โ€

โ€œI canโ€™t say one way or the otherโ€ whether the suspect had any contact with or direction from a foreign terrorist group, said U.S. Director of National Intelligence James Clapper Jr. on Tuesday. โ€œI canโ€™t point to external direction at this point.โ€

The gun that was found on Rahami after his shootout was a 9mm Glock he bought in July while in Virginia.

It was not immediately clear why Rahami traveled to Virginia or his ties to the state. Police stopped a car Sunday night in New Jersey they said had been at a location associated with Rahami; an official said on Tuesday that two of the five people in the car were from Virginia.