Passengers carrying backpacks, bags or packages onto New York City's subway trains will face random searches starting as early as Thursday night, the city's mayor said.

Michael Bloomberg made the announcement after a series of attempted bombings aimed at London's mass transit system earlier in the day. One person was injured.

Police officers watch as passengers enter the Times Square subway in New York City. (AP photo)
Police officers watch as passengers enter the Times Square subway in New York City. (AP photo)

"We just live in a world where, sadly, these kinds of security measures are necessary," Bloomberg said. "Are they intrusive? Yes, a little bit. But we are trying to find that right balance."

Passengers who don't want their belongings searched before they pass through the turnstile can choose to leave the subway station, police officials said in response to questions about privacy concerns.

Security officials will not target people of any particular race when carrying out the random searches, said police commissioner Raymond Kelly.

New York's 468 subway stations handle an average of 4.5 million passengers every weekday.

Thursday's latest attacks in London came two weeks after a seemingly co-ordinated series of bombings in the British capital killed at least 56 people on three subway trains and a double-decker bus.

The July 7 attacks were blamed on suicide bombers who were likely Islamic extremists.

Video footage recorded two hours before the attacks showed the four men entering Luton railway station, wearing large backpacks.