Three men, including the two who were shot, were arrested and were expected to be charged with terrorist offences.
The Mayor of New York, Rudolph Giuliani, called a press conference to give details of the raid, which took place at 4.40am after a tip-off the night before.
A man had flagged down a police car, saying that there were bombs in his flat. The man was detained for questioning, nearby buildings were evacuated and the area cordoned off before the raid.
When the police entered the flat, in a two-storey building built over a branch of the New York subway, the occupants were asleep. They were shot, according to police, when they "lunged toward what appeared to be a bomb".
Mr Giuliani said it appeared that they had been trying to detonate the explosives.
Underground services were disrupted on several lines during the morning rush-hour, inconveniencing 300,000 people.
According to Mr Giuliani, investigators were considering the possibility of a plot to terrorise New York by planting bombs on the underground. "We know there is information suggesting there was such a plot," he said, "but we don't know how realistic it is at this point." He stressed that if there had been any danger to the city, that was now over.
He said there was no connection between bombs found yesterday and the attacks in Jerusalem the previous day, but said that one of those arrested had "expressed support for what happened in Israel".
There was no information about the nationalities of the three men arrested.Reuse content