Beto O'Rourke linked the terrorist attack at a New Zealand mosque to President Donald Trump's rhetoric while speaking in Iowa Friday.

The Democratic presidential candidate opened up his second day in Iowa talking about the attack that killed 49 people in Christchurch, New Zealand. The shooting, which the perpetrator streamed live online, is the most deadly massacre in the country's history.

O'Rourke tied the New Zealand attack to instances of racism and intolerance he's seen in America. He said comments made by "national leadership" about Muslims and Mexicans have made many feel unwelcome in the U.S., but added that America is sending thoughts and prayers to New Zealand.

► The news Iowa depends upon. Subscribe to the Des Moines Register.

"But I hope that you will agree with me that it is not enough just to be compassionate, thoughtful and prayerful at this moment," O'Rourke said.

The U.S. and others need to go beyond just offering condolences and "confront this hatred" that causes mass shootings like this to happen, the Democrat from El Paso, Texas said. He noted that such hatred is "on the rise around the western world."

"We must call out this hatred, this Islamophobia, this intolerance and the violence that predictably follows from the rhetoric that we use," O'Rourke said. "We must be far better than that. We know that we are, and we need leadership that reflects it."

In October 2018, 11 people were killed in a shooting at a Pittsburgh synagogue. Many similarly linked the events to white nationalist sentiments. In Des Moines, a protester compared Rep. Steve King's views and ideology to those of the suspect in the Pittsburgh shooting because of the Iowa congressman's controversial views on immigration.

Trump tweeted his "warmest sympathy and best wishes" to New Zealand on Friday after the attack, and said "the U.S. stands by New Zealand for anything we can do."

Presidential candidate John Delaney also tied the New Zealand shooting to the rise of racism and other forms of bigotry in a news release Friday.

"This particular act of terror was linked to dangerous trends in white supremacy and racial hatred, something that is deeply wrong and must be condemned in the strongest way possible," Delaney said. "We must both publicly reject hate-driven attacks and violence and we must condemn those that amplify racist and hateful rhetoric."