And in one of the sharpest exchanges of the night, Mr. Cruz argued that Mr. O’Rourke often sided against the police, and accused the congressman of describing law enforcement officers as “modern day Jim Crow.” Mr. Cruz added, “I think it is offensive to call police officers modern day Jim Crow. That is not Texas.”

Mr. O’Rourke denied that he described police officers that way. On Wednesday, at a town hall event at Prairie View A&M University, a historically black college in Prairie View, Tex., Mr. O’Rourke had complained about racism within the criminal justice system, including racial profiling and unjust police shootings of people of color.

According to a video clip of part of his speech, Mr. O’Rourke referred to a system in which police officers suspect, search and shoot people “solely based on the color of their skin,” and added, “It is why some have called this, and I think it is an apt description, the new Jim Crow.”

Standing behind a podium at Friday’s face-off, Mr. Cruz came off as the more experienced debater and the more aggressive candidate. Mr. O’Rourke, taking the stage for the most important and most widely watched debate of his political life, seemed primed not to demolish his opponent but rather win over the audience in Dallas and beyond.

Mr. O’Rourke has been running as an outspoken liberal, convinced that political authenticity and a message aimed across demographics and age groups can help him pull off the biggest upset in modern Texas political history. Yet Mr. O’Rourke often seemed on the defensive, an unusual posture for a politician known for his charisma, and he struggled to build big flourishes into bite-sized 90-second answers.