This is an archived article and the information in the article may be outdated. Please look at the time stamp on the story to see when it was last updated.

An explosion struck the Port Authority bus terminal at 42nd Street and Eighth Avenue near Times Square on Monday morning, injuring four people and causing chaos in one of the busiest commuter hubs in the city, authorities said.

A man is in custody, the New York Police Department said in a tweet, and he is among the four people suffering non-life-threatening injuries after the blast, according to the New York City Fire Department.

The A, C and E subway lines were evacuated, NYPD Sgt. Brendan Ryan said. The subway entrance on Eighth Avenue and the bus terminal are closed, the Port Authority said in a tweet, adding that there was still police activity in the area.

Aerial footage from the scene showed police cruisers, emergency vehicles and hundreds of police and fire personnel in the street outside the terminal.

“Could have been a lot worse,” a federal law enforcement source told CNN.

Preliminary information, according to two law enforcement sources, one local and one federal, indicates a pipe bomb may have unintentionally exploded.

A man wearing a homemade device attempted to detonate it, and it either malfunctioned or did not go off the way it was supposed to, according to one NYPD source.

Francisco Ramirez said he heard two explosions as he was exiting a bus about 7:45 a.m. ET. He heard both blasts distinctly even though he was wearing headphones.

“From what I saw it sounded like it came from the subway, but I’m just guessing,” he said. “It was two distinct explosions seconds from each other. As I was making my way toward the outside, I kept getting shoved by cops and there were cops at every entrance blocking and there was police and SWAT everywhere.

“It was scary. It was just a lot of chaos but I didn’t see any injuries.”

Marlyn Yu Sherlock was at a retail store on the main floor of the terminal when people began flooding out of the subway entrance, “screaming, running in panic,” she said.

“The PA system was still blaring Christmas carols,” Sherlock said. “It took about four minutes before men in black cop uniforms started shooing people out of Port Authority. As I walked further away from the building, I kept asking the heavily armed cops what it was. They said ‘suspicious package.'”

Gov. Andrew Cuomo is on the scene and has been briefed by law enforcement, and Mayor Bill de Blasio is en route. In a tweet, White House press secretary Sarah Sanders said President Donald Trump, too, had been briefed.

The incident comes a few weeks after a deadly terror attack in Lower Manhattan.

A man was charged with killing eight people and injuring a dozen others as he drove a pickup truck down a bicycle path near the World Trade Center on Halloween. He was arrested after the truck hit a school bus, stopping it in its tracks. He exited the vehicle and an officer shot him.

The suspect, Sayfullo Habibullaevic Saipov, was indicted last month on murder and terror-related charges, the US Attorney’s Office for the Southern District of New York said. Saipov pleaded not guilty to 22 federal counts.

It was the deadliest terror attack in New York City since the September 11, 2001 attack on the World Trade Center.