A Pakistan court on Thursday barred authorities from arresting a former three-time prime minister, Nawaz Sharif, upon his expected return home on Saturday from four years in self exile, his lawyer said.

Lawyer Azam Nazeer Tarar told reporters that Sharif had been granted protective bail, under which authorities could not arrest him until he himself appears before a court on Oct 24.

Sharif was convicted on corruption charges, which he denied, in two cases in 2018. A court allowed him to travel to London for medical treatment in 2019.

The veteran politician has said he was ousted as prime minister in 2017 by leaders of the powerful military and the judiciary after he fell out with the generals.

The military, which has ruled Pakistan for extended periods since independence in 1947 and retains significant influence, even over civilian government, denies that.

Tarar said Sharif would follow up appeals against his convictions, which have been pending since he left, in the hope of overturning them and campaigning for a general election scheduled for early next year.

Nawaz Sharif's younger brother, Shehbaz Sharif, was prime minister from 2022 until this year, when his government was replaced by a caretaker administration upon the dissolution of parliament in advance of the general election. (Reporting by Asif Shahzad; Editing by Muralikumar Anantharaman, Robert Birsel)