New York City is spending $50 million to install 1,500 protective barriers around the city, including in Times Square, after two deadly attacks last year involving people who drove cars into pedestrians.

Mayor Bill de Blasio, a Democrat, announced Tuesday that the city would install the permanent bollards throughout the city's five boroughs.

“In 2017, New Yorkers witnessed the horrible capacity of people willing to do us harm,” de Blasio said. “But we will not be cowed, and our expanded investment today in barriers and bollards in our public spaces underscores our resolve in keeping New York City safe from future attacks. In this new year, we can and will protect our iconic public spaces while New Yorkers go on living our lives, including by hosting a record number of tourists.”

The city installed temporary concrete barriers at high-profile locations in New York City last year, and those barriers will be replaced by permanent metal bollards that will be installed beginning in March. De Blasio’s office said it will take several years for the installation to be complete.

There are currently 50 areas of New York City with permanent public bollards, according to the New York Daily News, and de Blasio said the additional barriers will “make sure that the vehicles can never come into the places where pedestrians are.”

In two separate incidents last year, motorists plowed their cars into pedestrians in New York City.

In May, a man drove his car into people in Times Square, killing one and injuring 2 others. The man drove his car on the sidewalk for three blocks before hitting a pole.

The incident was not related to terrorism, de Blasio said at the time.

In October, a man killed eight people when he drove a rented truck down a bike path in Manhattan. Sayfullo Saipov, an immigrant from Uzbekistan, was charged with terrorism and murder in aid of racketeering in November.