The Boston Marathon bombing suspects were planning to drive to Manhattan and detonate their remaining explosives in Times Square, New York City officials said Thursday.

They said Dzhokhar Tsarnaev, the surviving suspect, told investigators from his hospital bed that he and his older brother hatched the New York plan on April 18, hours before their deadly encounter with law enforcement officers. Police Commissioner Raymond Kelly, who has been briefed by federal officials, said at a news conference that the brothers were planning to use a pressure-cooker bomb similar to the one that detonated at the marathon, along with five pipe bombs.

Police foiled the alleged plan by engaging Tamerlan Tsarnaev, 26, in a firefight early Friday in which he was killed and a transit police officer was seriously injured. Dzhokhar Tsarnaev, 19, escaped but was subsequently captured hiding in a boat in Watertown, Mass., Friday evening.

“We don’t know if we would have been able to stop the terrorists had they arrived here from Boston,” New York Mayor Michael Bloomberg said. “We’re just thankful that we didn’t have to find out that answer.”

The revelation of the alleged New York plot added a new and haunting twist to the events that started with last Monday’s Boston attack, which killed three people and wounded more than 250. New York City has been a familiar terrorist target, especially on Sept. 11, 2001, when the World Trade Center towers were toppled.

Times Square is also a highly symbolic target, and in May 2010 police arrested Faisal Shahzad, a former financial analyst, for trying to set off a bomb there that fizzled before it could explode. He was convicted in federal court and sentenced to life in prison. Authorities said the Pakistani Taliban was behind that attempted attack.

Dzhokhar Tsarnaev was photographed in Times Square last April and was in New York City again in November, and Kelly said the police department’s Intelligence Division is investigating his movements there. The NYPD has built up a massive anti-terrorism apparatus since 2001, to a degree apparently unprecedented in a U.S. city.

The possible New York connection comes as more information is emerging about the interrogation of Tsarnaev. Authorities say the suspect was questioned for many hours, starting Saturday night and ending sometime before he was formally charged Monday in federal court in Boston.

He stopped talking, officials said, after lawyers were appointed for him. That could become an issue for congressional Republicans, who had urged the Obama administration to declare Tsarnaev an “enemy combatant” instead of charging him in federal court so he could be questioned longer.

In the Boston bombing, law enforcement officials have said they do not believe the brothers were connected with a terrorist organization, but they cautioned that the inquiry is at an early stage.

Multiple federal law enforcement officials have also said that Dzhokhar Tsarnaev had no firearms when he came under a barrage of police gunfire that struck the boat where he was hiding, though police feared he was heavily armed.

Authorities said they were desperate to capture Dzhokhar Tsarnaev so he could be questioned. The FBI, however, declined to discuss what prompted the gunfire.

Other law enforcement officials said the shooting may have been prompted by the chaos of the moment and some action that led the officers to believe Tsarnaev had fired a weapon or was about to detonate explosives.

These new details emerged as investigators continued their examination of the movements and motives of the two brothers in a massive worldwide probe.

Law enforcement officials described the 30 minutes before the arrest of Tsarnaev as chaotic. One characterized it as “the fog of war” and said that in a highly charged atmosphere, one accidental shot could have caused what police call “contagious fire.”

Officers from several agencies gathered around the Watertown house as darkness fell. The FBI was in charge of the scene, but there also were officers from the Massachusetts State Police, local police and transit police.

“They probably didn’t know whether he had a gun,” said one law enforcement official, who like others interviewed for this article spoke on the condition of anonymity to discuss an ongoing investigation. “Hours earlier, he and his brother had killed a police officer, shot another officer and thrown explosives out of their cars as the police were chasing them. They couldn’t assume that he did not have a gun and more explosives.”

The FBI declined to discuss the exact sequence of events that led officers to open fire on Tsarnaev’s hiding place and whether the dozens of bullets that struck the boat caused any of his gunshot wounds.

A spokesman for the FBI said law enforcement agents were tracking an extremely dangerous suspect who had used guns and explosives on a public street to avoid arrest.

“Law enforcement was placed in an extraordinarily dangerous situation,” said FBI spokesman Paul Bresson. “They were dealing with an individual who is alleged to have been involved in the bombings at the Boston Marathon. As if that’s not enough, there were indications of a carjacking, gunfire, an ambushed police officer and bombs thrown earlier. In spite of these extraordinary factors, they were able to capture this individual alive with no further harm to law enforcement. It was a tremendously effective outcome under dire circumstances.”

Early Friday in Watertown, the brothers engaged in a firefight with police. Tamerlan Tsarnaev was shot and fell to the ground, according to police and photos, and Dzhokhar Tsarnaev climbed back in a Mercedes sport-utility vehicle carjacked earlier. He drove at police and struck his wounded brother on the street. Tamerlan Tsarnaev, who was dragged a distance by the car, was declared dead on arrival at a Boston hospital.

A criminal complaint filed in federal court in Massachusetts on Monday to support charges against Dzhokhar Tsarnaev said police recovered a single firearm and half a dozen explosives and homemade bombs from the scene of the shootout.

In the ensuing chaos, Tsarnaev accelerated away, abandoned the car and eventually made it on foot just beyond a cordon quickly set up by police. Around 6 p.m. Friday, Tsarnaev was detected hiding beneath a plastic cover on a boat by its owner, who called police. A thermal imaging unit in a police helicopter confirmed a presence in the boat.

“You can’t second-guess what they were doing on that scene,” said a second law enforcement official. “Their own lives were in danger.”

In the immediate aftermath of Tsarnaev’s capture, police officials said he had fired from the boat and he was reported to have been captured with several weapons. There were also reports that the gunshot wound he suffered to the throat might have been an attempt to kill himself as police moved in.

Tsarnaev continues to be treated at a Boston hospital, where his condition has been upgraded from critical to fair. He began communicating in writing and some speech with a special team of FBI interrogators Saturday night and was officially charged Monday.

On Wednesday, Vice President Biden eulogized Sean Collier, the slain Massachusetts Institute of Technology police officer, and denounced Tsarnaev and his dead brother as “two twisted, perverted, cowardly knockoff jihadis.”

Thousands of MIT students and police officers from across the United States attended a memorial service on the grounds of the university to remember the 27-year-old police officer.

Jenna Johnson in Boston and David Montgomery and Julie Tate in Washington contributed to this report.

Discuss this topic and other political issues in the politics discussion forums.