PESHAWAR, Pakistan (AP) — A Chinese national who was arrested in Pakistan on charges of blasphemy has been released from a high-security prison after a court granted him bail, a defense lawyer and local police said Friday.

Atif Khan Jadoon, the lawyer for the man who has been only identified as Mr. Tian said the Chinese national was granted bail by a judge in the northwestern city of Abbottabad on Thursday.

Tian was released after he filed a surety bond of 200,000 rupees ($700), Jadoon said.

The latest development comes weeks after Tian, who worked on a dam project, was detained after hundreds of residents and laborers in the town of Komela in northwestern Pakistan blocked a key highway and demanded his arrest. They alleged that Tian used insulting remarks about Islam, a charge the man denies.

Tian was part of a group of Chinese working on the Dasu Dam, the biggest hydropower project in Pakistan. He was accused of blasphemy on April 15 after he criticized two drivers working on the project for taking too much time to pray during work hours.

Authorities say Tian was briefly hospitalized on April 17 as he was not feeling well.

Tian pleaded not guilty during his earlier appearance before the court. He also insists that he did not insult Islam or the Prophet Muhammad, according to his lawyer and local police officials who questioned him.

Beijing has said that the Chinese embassy in Islamabad was looking into the matter.

According to police, they arrested Tian to save him from a potential attack by angry residents. The arrest of Muslims and non-Muslims on charges of blasphemy are common in Pakistan, but foreigners are rarely among those detained.

In 2021, a mob lynched a Sri Lankan man at a sports equipment factory in the eastern Punjab province. It later burned his body in public over allegations he desecrated posters bearing the name of the Prophet Muhammad.