New York City Marathon taking place in the wake of deadly truck attack

The marathon takes place just five days after a deadly truck ramming attack.

More than 51,000 people will participate in this year's marathon, while another 2.5 million spectators are expected to line New York City streets as the world-famous race takes runners through all five boroughs. The route begins on Staten Island, enters Manhattan via the Queensboro Bridge at East 59th Street and ends in Central Park.

The marathon is taking place several miles north of the scene of Tuesday's deadly attack, in which a man driving a Home Depot truck plowed into pedestrians and cyclists on a busy bike path near West Houston Street and the West Side Highway. The suspect drove south for about a mile before crashing into a school bus near Chambers Street, just across from Stuyvesant High School, authorities said.

The suspect, identified as 29-year-old Sayfullo Saipov, was transported to a hospital for treatment and is expected to survive. He is believed to have acted alone, authorities said.

According to a federal criminal complaint filed Wednesday by prosecutors in the U.S. District Court for the Southern District of New York, Saipov was allegedly "inspired" to commit the attack after watching ISIS videos on his cellphone and he "wanted to kill as many people as he could."

Saipov also wanted the black-and-white flag of ISIS displayed in his hospital room after allegedly revealing to authorities he had planned to strike more people on a bridge had he not crashed into a school bus, according to the complaint.

"During the interview with law enforcement, Saipov requested to display ISIS's flag in his hospital room and stated that he felt good about what he had done," the complaint states.

Saipov has a preliminary hearing scheduled for Nov. 15 at 10 a.m. ET.

"He did this in the name of ISIS, and along with the other items recovered at the scene was some notes that further indicate that," John Miller, NYPD deputy commissioner of intelligence and counterterrorism, said Wednesday morning. "He appears to have followed almost exactly to a 'T' the instructions that ISIS has put out in its social media channels before with instructions to their followers on how to carry out such an attack."

In the wake of Tuesday's incident, which is being investigated as a terror attack, state and local authorities beefed up security across New York City and along the marathon route for Sunday's race.

"It will be the most ever deployed at this event," Gomez said.

In addition to regular uniformed police, there will be officers in civilian attire "mixing in with the crowds to detect any suspicious activity," Gomez said. K-9s and counterterrorism officers will also be deployed along the marathon route, as well as aviation patrols above.

Meanwhile, the New York State Police and the New York National Guard will respectively double and triple personnel deployment throughout the city. The Port Authority of New York and New Jersey Police Department will more than double personnel deployment and add patrols at airports, bridges, tunnels and other high-profile locations.

"While there is no apparent threat, we are ramping up security across New York City with patrols and resources from various state law enforcement agencies out of an abundance of caution. These brave men and women will be out in full force to ensure the safety of New Yorkers during tomorrow's marathon, and I look forward to another year of this storied New York tradition," Cuomo added.

Authorities remind residents and tourists to stay alert to their surroundings and report any suspicious activity. Reports can be made by calling 911, by calling the NYC terrorism hotline at 1-888-NYC-SAFE or by calling the New York State Division of Homeland Security and Emergency Services' counterterrorism unit's tip line at 1-866SAFENYS or emailing ctcenter@nysic.ny.gov.