NEW YORK -- New details are coming to light about overseas trips that the suspect in the New Jersey and New York blasts took prior to the bombings.

Ahmad Khan Rahami, the primary suspect in three separate bombing incidents in New York City and New Jersey, was taken into custody in Linden, N.J., after a shootout with police on Monday afternoon.

Ahmad Khan Rahami’s booking photo on Monday, Sept. 19, 2016. Union County Prosecutor's Office

The Union County, N.J., Prosecutor’s office announced Rahami has been charged with five counts of attempted murder and two gun charges. Federal officials are still examining the possibility of terrorism-related charges.

Get Breaking News Delivered to Your Inbox

Bail for Rahami was set at $5.2 million by state Superior Court Judge Regina Caulfield.

Rahami, 28, a naturalized U.S. citizen from Afghanistan who lived with his family in Elizabeth, New Jersey, underwent surgery for a gunshot wound to the leg as authorities began drawing up charges in a case that spread fear across the New York area and revived anxiety about homegrown terrorism.

A senior law enforcement official told CBS News senior investigative producer Pat Milton that Rahami traveled to Afghanistan at least three times, the last time believed to be in 2014. The official said It is unclear at this time the purpose for the trips, investigators are seeking to see if the travel was to visit family or for other reasons.

CBS News’ Andy Triay and Milton reported that two law enforcement sources said that Rahami also traveled to Pakistan during at least one of his trips to Afghanistan.

A U.S. federal intel source tells CBS News that Rahami has a wife who lives overseas.

According to the source, Rahami was not on any Department of Homeland Security watch or travel restriction lists. He had a CBP interview as protocol for people who spend a year away in places like Afghanistan. He returned from Afghanistan in 2014.

The source said Rahami is not cooperating with law enforcement officials.

A New Jersey congressman said Rahami contacted his office from Pakistan in 2014 to help get his pregnant wife a visa.

Rep. Albio Sires said that Rahami emailed his office from Pakistan in 2014 seeking help because his wife had an expired Pakistani passport.

Sires said his office wrote a letter to the U.S. embassy in Pakistan to check on the status of the case and that the woman eventually received a visa. He says he doesn’t know if she ever came to the country and the FBI didn’t answer when asked on Monday.

Sires says he contacted the FBI about the encounter on Monday after Rahami was named as a person they were seeking for questioning.

So far investigators have not uncovered any direct links to ISIS or any other terrorist organization, CBS News homeland security correspondent Jeff Pegues reported.

The mayor of Linden, N.J., Derek Armstead, said the Afghan immigrant was captured on Monday after the owner of a bar reported someone asleep in the doorway of his establishment.

CBS New York reported that when Linden police approached the man, the man raised his head and that’s when one of the officers recognized him as Rahami, Capt. James Sarnicki said.

Photo of the two officers who were shot. Officer Angel Padilla, left, and Officer Peter Hammer, right. Handout from Linden Police

“The suspect pulled out a gun and fired at the officer and striking him in the abdomen,” Sarnicki said, adding the officer was shot in his bulletproof vest.

Officials say two officers were eventually shot, although neither suffered serious injuries. Rahami was also shot multiple times by officers and was taken to a hospital.

A massive manhunt was launched and millions of New York City-area residents were alerted directly earlier Monday after police identified Rahami as a suspect in connection with the Chelsea bombing that injured 29 people.

Cellphone users across the tri-state area were alerted to the 28-year-old suspect’s name and description around 8 a.m. on Monday with a system normally reserved for flash flood warnings and Amber alerts.

The arrest came just hours after police issued a bulletin and photo of Rahami.

Around the time Rahami was taken into custody, President Barack Obama was in New York on a previously scheduled visit for a meeting of the U.N. General Assembly, and said it was “extremely fortunate” nobody was killed in the bombings.

He called on Americans to show the world “we will never give in to fear.”

“We all have a role to play as citizens to make sure we don’t succumb to that fear. And there’s no better example of that than the people of New York and New Jersey,” the president said. “Folks around here, they don’t get scared.”

Officials say surveillance video places Rahami at the scene of both the bomb that exploded in Chelsea, as well as the one four blocks away that failed to explode and was taken away by police.

Milton reported that Rahami was identified at least in part because he left a fingerprint on one of the unexploded devices.

While officials in New York and New Jersey are still investigating Rahami’s motives, New York City Mayor Bill de Blasio said after his capture that “now we have every reason to believe this is an act of terror.”

De Blasio said despite Rahami’s arrest, there will still be a large police presence in New York, especially with the beginning of the United Nations General Assembly this week.

Rahami was also sought in connection with the bombing in Seaside Park, New Jersey, as well as the five explosive devices found in a backpack near a train station in Elizabeth, New Jersey, the suspect’s hometown.

The FBI bulletin (PDF) on Rahami stated he “is a 28-year-old United States citizen of Afghan descent born on January 23, 1988, in Afghanistan. His last known address was in Elizabeth, New Jersey.”

The bulletin warned that he “should be considered armed and dangerous.”

What helped the investigation was the extensive system of cameras in New York.

New York City Police Deputy Commissioner for Intelligence and Counterterrorism John Miller told CBS News earlier this year that New York City has an elaborate monitoring software to pull information together in real time, known as the Domain Awareness System (DAS) with 8,000 cameras and license plate readers.

Rahami lived with his family on a busy street a few miles from the Newark airport. Early Monday, FBI agents swarmed the apartment.

Elizabeth Mayor Christian Bollwage said Rahami’s father, Mohammad Rahami, and two brothers sued the city after it passed an ordinance requiring the First American Fried Chicken restaurant to close early because of complaints from neighbors that it was a late-night nuisance.

In the lawsuit, Mohammad Ruhami and two of his sons claimed that starting in July 2008, Elizabeth police and city officials improperly tried to restrict the their fast-food restaurant’s hours.

The lawsuit was terminated in 2012 after Mohammad Ruhami pleaded guilty to blocking police from enforcing the restriction. The city was fighting the claims.

Ahmad Khan Rahami was not part of the lawsuit.

The family claimed that baseless citations were issued against them, spawned by complaints filed by residents who disliked them and made anti-Muslim comments to them.

Ryan McCann, of Elizabeth, said that he often ate at the restaurant and recently began seeing the younger Rahami working there more.

“He’s always in there. He’s a very friendly guy, that’s what’s so scary. It’s hard when it’s home,” McCann said.

Officials had been seeking a connection between the string of attacks that started Saturday and unfolded in a short time span.

The first attack happened at a road race to benefit Marines and sailors at the Jersey Shore at 9:30 a.m. Saturday. The race had been scheduled to start shortly before the blast occurred, but was delayed due to the large numbers of people registering for the race and reports of an unattended backpack being found.

Officials noted that if the race had started on time, a “good number of people” would have been running past the area where the explosion occurred. The device used was described as a pipe bomb set off with a cellphone trigger.

The second attack happened Saturday night at around 8:30 p.m. in New York City’s bustling Chelsea neighborhood, known for its vibrant nightlife. While 29 people were injured in the blast, none were hurt seriously and all were released from the hospital within 24 hours. Officials say the device used was a pressure cooker bomb also set off by a cellphone trigger. A second, very similar device was discovered later just a few blocks away and was removed before it could be set off.

The bomb that rocked the bustling Manhattan neighborhood contained residue of Tannerite, an explosive often used for target practice that can be picked up in many sporting goods stores, a federal law enforcement official said Sunday.

However, no Tannerite residue was identified in the New Jersey bomb remnants, in which a black powder was detected, said an official who spoke to The Associated Press on condition of anonymity because the official was not authorized to comment on an ongoing investigation.

A source tells CBS News three cellphones with the two New York devices and one associated with the Seaside Park device are described as flip phones.

At least four flip phones were purchased for the bombs in N.J., sources told CBS News. One was bought over a year ago.

Officials haven’t revealed any details about the makeup of the pressure-cooker device, except to say it had wires and a cellphone attached to it. However, sources told CBS News the bombs were also made of balling bearings, and Christmas tree lights. Christmas lights were also used in the bombs made by the San Bernardino shooters. The Christmas tree lights were believed to serve as a fuse in the San Bernardino case, sources previously told CBS News.

In Elizabeth, New Jersey, the last known address for the Rahami, Mayor Bollwage said after five more pipe bombs were discovered near a train station around 8:30 p.m. Sunday evening that he didn’t believe his town had been deliberately targeted. Bollwage said it was possible that someone worried about the authorities was trying to get rid of the package.