U.S. Sen. Ted Cruz, R-Texas, and his Democratic challenger, U.S. Rep. Beto O'Rourke of El Paso, have agreed to three debates before Election Day.

Announced Friday by both campaigns, the schedule calls for debates Sept. 21 in Dallas, Sept. 30 in Houston and Oct. 16 in San Antonio. Each event will be an hour long and vary in topic and format:

Dallas: Domestic policy, moderated

Houston: Domestic policy, "town hall style"

San Antonio: Half domestic policy, half foreign policy; moderated

The Dallas debate will be at Southern Methodist University, the Houston debate will be at the University of Houston and the San Antonio debate will be at a studio there.

The announcement caps a debate over debates that began in May when O'Rourke proposed six debates with Cruz, two in Spanish. Cruz, who is not fluent in the language, quickly shot down that idea and maintained he was open to debating O'Rourke but wanted to wait until closer to Election Day to talk debate details and lock in a schedule.

In July, Cruz formally responded to O'Rourke's debate challenge, proposing five topical debates over three months in five cities. O'Rourke took issue with several aspects of Cruz's counter-offer, including the fact all the debates would be on Friday evenings during high school football season. O'Rourke also asked Cruz if they could add a sixth debate in O'Rourke's hometown of El Paso, and Cruz offered to swap out one of the five cities in his plan for El Paso.

While the schedule announced Friday does not feature a debate in El Paso, it does include days that are not Friday. The Dallas debate falls on a Friday, but the ones in Houston and San Antonio are on a Sunday and Tuesday, respectively.

For weeks, the two campaigns had appeared to be at a stalemate. Seeking to force O'Rourke's hand, Cruz accepted an invitation from two Dallas media outlets to debate O'Rourke on Aug. 31 in that city — which had been part of Cruz's proposed schedule — but O'Rourke declined to follow suit, citing continued problems with the debate negotiations. More recently, Cruz expressed doubt that debates would even happen with the two sides at loggerheads and the clock ticking until Election Day.

Early voting begins Oct. 22.