Turkish police on Friday detained dozens of students protesting against President Recep Tayyip Erdogan's appointment of a party loyalist as the head of a top Istanbul university.

The student demonstrations have been running across Turkey's main cities since January, when Erdogan named Melih Bulu as the rector of the elite Bogazici University.

Protesters gather outside Istanbul's main court in a show of support for friends detained for displaying a rainbow flag
Protesters gather outside Istanbul's main court in a show of support for friends detained for displaying a rainbow flag AFP / Ozan KOSE

Dozens of protesters gathered outside Istanbul's main court on Friday in a show of support for friends who were detained for displaying a rainbow flag during another demonstration the day before.

Police cordoned off the area and prevented the students from making a statement to the press, AFP journalists outside the court reported.

The police eventually moved in, wrestling some of the students to the ground as they rounded them up before putting them on a waiting bus.

Police cordoned off the area and prevented the students from making a statement to the press
Police cordoned off the area and prevented the students from making a statement to the press AFP / Ozan KOSE

A lawyer representing the students said 42 people had been detained.

"We are not silent, we are not afraid, we do not obey," the students chanted as the police moved in. "The rector will leave but we will stay."

The students see Bulu's appointment as part of Erdogan's broader effort to centralise control over universities.

The row has intensified after protesters hung a poster near Bulu's office depicting Islam's holiest site in Mecca draped in LGBT imagery in late January.

Bogazici University's LGBT club was disbanded after the incident.

Erdogan last month compared some of the students to "terrorists" and said the LGBT cause incompatible with the country's values.