WASHINGTON — To an amateur eye, Ahmad Khan Rahami’s travel history might appear to be a red flag: He had traveled to Pakistan, the home of Al Qaeda, four times between 2005 and 2014. The last time he stayed for a year.

So Mr. Rahami’s arrest in the bombings last weekend in New York and New Jersey — and the revelation that he cited jihadist leaders in his journal — has raised an obvious question: Did the government miss something?

Possibly. But Mr. Khan’s extended family, originally from Afghanistan, lives in Pakistan, and he told customs officials on his return from his trips that he had been visiting family, officials said. He had married a Pakistani woman during a 2011 visit. In 2014, he had to arrange an American passport for their baby, born that year in Pakistan. Both are plausible explanations for an extended stay.

An initial review of the government’s handling of Mr. Rahami’s travel, based on records described by law enforcement officials, suggests no obvious lapses. That could change if more details of his exchanges with border officials become public.

In 2006 and 2011, Mr. Rahami was subjected to extra airport screening, but no further consequences, when he returned to the United States, officials said.

Mr. Rahami’s arrival at Kennedy International Airport in March 2014 appears to have received the most scrutiny. Because he had arrived on a one-way ticket from Pakistan — a trigger for extra attention — he was questioned again in a secondary interview. But for an American returning home from a lengthy stay abroad, the one-way ticket he used made sense, and he was not held or further delayed.

Officials now believe that Mr. Rahami may have taken a side trip to Ankara, Turkey, in January 2014. It is not clear whether he informed customs officials about that trip.

Still, customs officers who spoke with him thought information from the interview should be shared more broadly, so they forwarded a report to the National Targeting Center, an analysis hub run by U.S. Customs and Border Protection. Officers at the center, in turn, thought the report on Mr. Rahami was significant enough to distribute to other law enforcement agencies, including the Federal Bureau of Investigation, in a summary that is sent out every few days.

Officials familiar with the report said it contained no hard information that might have caused alarm or prompted immediate action. Certainly, there was nothing approaching the significance of a statement that Mr. Rahami’s father gave to the F.B.I. five months later, in which he said he thought that his son might be involved in terrorism. 

The National Targeting Center, near Washington, was set up after the Sept. 11, 2001, terrorist attacks and became part of the customs and border agency in 2002. In 2007, it was divided into two parts, one focusing on cargo, the other on passengers. Its operations were stepped up further after the so-called underwear bomber, Umar Farouk Abdulmutallab, tried to blow up an airliner as it prepared to land in Detroit. In recent weeks, the passenger and cargo operations were combined into one office again, officials said.

Dozens of officers comb through passenger lists for all flights arriving in the United States, which include about 300,000 people each day, as well as cargo manifests — looking, in essence, for the needle in the haystack.

The center is in charge of identifying people who should be stopped or questioned at the borders. It also writes guidelines for when front-line customs officers should send passengers from certain countries or with unusual travel itineraries for additional questioning, as happened with Mr. Rahami.

The center has had its problems. A 2011 report from the Department of Homeland Security’s inspector general found that it had a staff shortage and described a cumbersome data system that made complete checks on incoming passengers difficult and time-consuming.

Targeting specialists at the time used “as many as four computer monitors with different databases open concurrently,” the report said.

For years after the 2001 attacks, one of the F.B.I.’s primary concerns was trying to catch Americans traveling to Pakistan to join Al Qaeda, in an effort to disrupt recruiting networks. Today, by contrast, the bureau is most intently focused on homegrown violent extremists who may be plotting attacks in the United States. Travel to so-called hot spots no longer stands out as an automatic sign of danger, especially when there is a reasonable explanation.

“It is an indicator, but you don’t even need to travel anymore to conduct an attack,” said Brenda Heck, a former senior F.B.I. counterterrorism agent who retired in 2012. “It is less now of an indicator than when I was working there.”

Still, as an F.B.I. agent, Ms. Heck said she would want to know what Mr. Rahami was doing in Pakistan.

“On one side of it, he’s likely got family, but we can’t know exactly what he did over there,” she said. “That’s troubling.”

The elaborate security measures in place for years at United States borders do not always work. In May 2013, a young man named Moner Mohammad Abusalha landed in Newark and was pulled aside for additional questioning. He told officers he had been in Jordan visiting family. In fact, he had secretly traveled to Syria.

One of the officers was suspicious and called his mother in Florida. She verified his story, and Mr. Abusalha passed through customs. The F.B.I. was never told about the call to the mother or about the officer’s suspicions. Mr. Abusalha later returned to Syria, joined a Qaeda affiliate in Syria and blew himself up in an attack.