(CNN) Democratic presidential candidate Beto O'Rourke came to the defense of fellow 2020 rival Pete Buttigieg after anti-gay protesters heckled Buttigieg at an event in Texas on Friday.

"Texans don't stand for this kind of homophobia and hatred. Mayor Pete, we are grateful you came to Texas and hope to see you and Chasten back again soon," O'Rourke, a former Texas congressman, wrote on Twitter.

Texans don't stand for this kind of homophobia and hatred. Mayor Pete, we are grateful you came to Texas and hope to see you and Chasten back again soon. https://t.co/IhRDtIBREb — Beto O'Rourke (@BetoORourke) May 4, 2019

O'Rourke elaborated on his decision to come to Buttigieg's defense while campaigning Saturday in Iowa.

"I'm a proud American, I'm a proud Texan, and the hatred directed towards Pete Buttigieg last night was not reflective or representative of my state or of this country, so I wanted to call it out immediately, first and foremost," he told reporters.

Buttigieg, the mayor of South Bend, Indiana, was addressing the Dallas County Democratic Dinner on Friday when his speech was interrupted at least four times by a group of protesters.

Read More