The letters were sent to Sha Tin and West Kowloon magistrates’ courts.
A police spokesman said the bomb disposal unit was also deployed to the scenes.
He added that the case in Sha Tin had been classified as criminal intimidation while the one in West Kowloon was listed as request for police investigation.
The judiciary said court proceedings were not affected. Registry and accounts offices at both buildings were temporarily closed, as was the bailiff’s office at Sha Tin.
The Department of Justice described the letters as “threatening” and said it strongly deplores recent cases of criminal intimidation of judges.
“Intimidation against judges and judicial officers is unacceptable to Hong Kong as a society which observes the rule of law,” a statement said.
“In any event that unlawful means is used with an aim to exert influence over court proceedings, the Hong Kong Special Administrative Region Government will take the case seriously and spare no effort in bringing the culprit to justice in order to safeguard the due administration of the judicial process and public peace.”