During the first prime-time GOP debate of the 2016 race, Sen. Ted Cruz attacked President Obama for failing to criticize radical Islam. But to make his point, Cruz praised an Egyptian regime that he has previously criticized himself.

"We need a president that shows the courage that Egypt's President al-Sisi, a Muslim, when he called out the radical Islamic terrorists who are threatening the world," Cruz said in reference to Egyptian President Abdel Fattah el-Sisi.

Egypt's president has indeed spoken about problems of extremism in Islam in the past and has said there is a need for a "religious revolution." But Cruz praising the Egyptian leader is quite peculiar given that in the past, he had criticized el-Sisi's regime.

The senator's statements during the debate do not necessarily mean Cruz supports all of el-Sisi's or the Egyptian regime's actions. But Cruz's line of attack shows that to criticize Obama, he is willing to go to lengths that may, at times, mean praising a political leader whose actions he does not fully support.

In 2013, two years after the protests in the Middle East began, the Egyptian military helped overthrow the government that was governed by the Muslim Brotherhood. At the time, el-Sisi was the top military commander and was considered the mastermind of the coup. In August of that same year, clashes between supporters of the Muslim Brotherhood and the military turned violent in the country, leaving 278 people dead.

Subsequently, Cruz released a statement saying the Obama administration's noncommittal response allowed the military to "act with impunity" toward the Muslim Brotherhood, which in turn led to violence against Coptic Christians in Egypt.

"When a military coup occurred, it failed to follow current U.S. law and suspend aid to Egypt, something that could have been done to encourage the new government to move swiftly toward democratic reforms," Cruz said at the time.

Cruz's spokeswoman Catherine Frazier said Cruz maintains his concerns he has raised in the past but it had no bearing on his praise for the Egyptian president for talking about the threat of radical Islamic terrorism when others are not willing to do the same.

"We should be working closely with him and encouraging him to continue civil reforms, which he might be more inclined to do if he were confident in U.S. support," Frazier told National Journal in a statement.

This article has been updated.

We want to hear what you think about this article. Submit a letter to the editor or write to letters@theatlantic.com.