Democratic presidential candidate Mike Bloomberg on Thursday defended the controversial surveillance program of American Muslims in New York City put into place following the Sept. 11, 2001 terror attacks during his time as mayor.

Bloomberg, who took office months after the attacks, has since said the program was part of an effort to keep the United States safe. In an interview with PBS NewsHour anchor and managing editor Judy Woodruff, Bloomberg said that surveilling the American Muslim community was “a natural place to go.”

“All of the people came from the same place and all that came were from a place they happened to be one religion. And if they’d been another religion, we would’ve done the same thing,” Bloomberg said.

“It does not, incidentally, mean that all Muslims are terrorists or all terrorists are Muslim. But, the people that flew those airplanes came from the Middle East and some of the imams were urging more of the same,” Bloomberg said, pointing to claims that “there were imams who publicly at that time were urging the terrorism.”

WATCH: Full interview with 2020 candidate Michael Bloomberg

A report by CUNY School of Law detailed the extent of the NYPD’s Intelligence Division surveillance, including an instance of an undercover officer going on a whitewater rafting trip with college students.

Bloomberg added that “the courts ruled [the surveillance program] was exactly within the law.”

Several lawsuits were filed against New York City’s program. Two of the suits were settled, therefore not allowing a determination to be made for either party. Those cases, Hassan v. City of New York and Raza v. City of New York, alleged that Muslims in New Jersey and New York, respectively, were improperly targeted by the program. As part of the Hassan v. City of New York settlement, reforms were later made in an effort to protect against religion-based surveillance.