SKOPJE, Macedonia — A former Macedonian intelligence chief has been taken into custody for a minimum of 30 days after judicial authorities considered him a flight risk to potentially avoid standing trial over a major wiretapping scandal.

The remand order, announced Wednesday, was issued for Saso Mijalkov who headed state security agency UBK for nearly a decade, until May 2015. Mijalkov is a cousin of former conservative prime minister Nikola Gruevski who fled to Hungary last week to avoid serving a two-year prison sentence for corruption. Gruevski said Tuesday he had been granted political asylum by Hungary.

Mijalkov, along with a former interior minister and other intelligence service officials, have been charged with ordering the illegal wiretapping of more than 20,000 people, including opposition politicians and journalists.