The Turkish president has hit out at military graduates who took a pro-secular oath during their graduation ceremony, promising that those behind it would be “purged” from the military.

Speaking at a conference for Islamic schools in the northwestern city of Kocaeli on Saturday, President Recep Tayyip Erdogan described those involved as “opportunists.” He added that an investigation was underway and vowed that ”the few impertinent individuals responsible will be purged.”

Turkey has become more overtly religious under Erdogan, shedding some of the secularist traditions of the original Kemalist republic.

Turkey’s military has traditionally viewed itself as the guarantor of secularism, which has resulted in a series of coups. It led three takeovers between 1960 and 1980 and toppled a conservative government in 1997. However in 2016, an attempt to overthrow Erdogan and his religious-conservative administration was foiled and thousands of people were purged from the armed forces, the judiciary, and other public institutions.