ISLAMABAD (Reuters) - Pakistan’s top court on Sunday said it had begun reviewing statements made by a judge alleging the country’s spy agencies were influencing judicial proceedings, as the powerful military called for an investigation.

FILE PHOTO - Hanif Abbasi, a nominated candidate of Pakistan Muslim League - Nawaz (PML-N) party for upcoming election, is seen in Islamabad, Pakistan May 30, 2017. Picture taken May 30, 2017. REUTERS/Faisal Mahmood

Pakistan’s July 25 general elections have been hit by accusations of pre-poll rigging with ousted prime minister Nawaz Sharif’s Pakistan Muslim League-Nawaz (PML-N) party accusing the military of influencing the judiciary to deny it a second term.

Islamabad High Court judge Shaukat Aziz Siddiqui accused the country’s premier spy agency, the Inter Services Intelligence (ISI), of interfering in legal cases.

“The ISI is fully involved in trying to manipulate the judicial proceedings,” Siddiqui said in a speech to lawyers, adding the agency had told the court not to release Sharif and his daughter Maryam until after the elections.

The former premier and his daughter, both facing lengthy prison terms on corruption charges, were arrested minutes after landing in the country on July 13 as they returned in a bid to revitalize their flagging party ahead of Wednesday’s elections.

Public criticism of the military by senior officials is rare in Pakistan, which has been ruled by the armed forces for half its 71-year history.

“In order to safeguard the sanctity and credibility of the state institutions, Honourable Supreme Court of Pakistan has been requested to initiate appropriate process to ascertain the veracity of the allegations and take actions accordingly,” the military said in a statement.

The Supreme Court had earlier issued a statement saying it had “taken serious notice” of Siddiqui’s speech.

Siddiqui is being investigated for alleged misconduct relating to the allocation and refurbishment of his official residence. He has denied the charges.

In March, Siddiqui gave a ruling stating that citizens who disguised their religious affiliation were guilty of betraying the state and ordered that anyone applying for government jobs should declare their faith, a move human rights advocates termed a blow for the country’s persecuted minorities.

Disqualification of candidates is one of the challenges the former ruling PML-N has faced ahead of the elections. Since Sharif was ousted by the Supreme Court last year, four party candidates have been barred from contesting the elections.

On Saturday a Pakistani anti-narcotics court jailed for life Hanif Abbasi, an aide of Sharif, for misuse of a drug-making chemical, a government prosecutor said.