Malaysia has deported three Turkish nationals wanted by Ankara for alleged links to a US-based cleric accused of being behind a failed coup against the government of President Recep Tayyip Erdogan.

Malaysia's national police chief of Khalid Abu Bakar tweeted that the men were "deported back to Ankara" on Thursday night, despite concerns from rights groups who fear Malaysia is bowing to pressure from Turkey.

Turgay Karaman and Ihsan Aslan were arrested last week under a security law which allows detention without trial for 28 days. Two days later Turkish academic Ismet Ozcelik was also arrested - ostensibly for national security reasons.

"Police investigations showed they were involved in FETO activities and are wanted by Turkey," Khalid said in a separate statement.

Turkish authorities allege last year's coup attempt against Erdogan was masterminded by US-based Muslim cleric Fethullah Gulen.

Khalid said the men's travel documents had been cancelled by Ankara and so they were regarded as illegal immigrants in Malaysia.

@PDRMsia confirmed that Turkish Nationals; MTURGAY KARAMAN; IHSAN ASLAN and ISMET OZCELIK was deported back to Ankara last night. — Khalid Abu Bakar (@KBAB51) May 12, 2017

The deportation of Karaman and Ozcelik has been termed "illegal and an abuse of power" by Rosli Dahlan, the lawyer who represted the duo following the arrests.

While Malaysian authorities did not notify the men's families of the deportation, Karaman's wife, Ayse Gul, said she was warned by a friend on Thursday night of her husband's situation.

On Friday morning, after getting through to a police official, she received confirmation of Karaman's deportation and was asked to pick up his belongings from the police station.

Ainnurul Aisyah Yunus, Asalan's wife, learnt of her husband's deportation after a journalist pointed her to Khalid's tweet confirming the move.

Rights groups have said they fear Malaysia may be responding to pressure from Turkey, which has mounted a huge crackdown on perceived opponents since the failed coup.

Phil Robertson, deputy Asia director at Human Rights Watch, said via a statement on Friday that the Malaysian government's "duplicity and crass abuse of the rights of these three men really sets this case apart".

"It's like Malaysia just hung a signboard around its neck that reads 'handmaiden of Turkish repression'."

Robertson added that Malaysia's decision to deport the men meant that they could face possible torture and prolonged detention, followed by an unfair trial.

The UN Office of the High Commissioner for Human Rights for Southeast Asia last week expressed serious concern about the arrests and urged Malaysia to refrain from deporting the men to Turkey.

Erdogan's government has detained or sacked tens of thousands of people under a state of emergency imposed after the attempted power grab.

The crackdown focuses on alleged supporters of Gulen.