Pakistan’s top court disqualified the country’s Prime Minister Nawaz Sharif from office on Friday, with a bench of five judges unanimously ruling against him in a corruption case that has divided the South Asian nation.

The Supreme Court in Islamabad disqualified Sharif in a case connected to allegations stemming from the so-called Panama Papers — secret documents leaked from the Panama-based law firm Mossack Fonseca in 2016 that detailed the offshore financial dealings of public figures from around the world.

“He is no more eligible to be an honest member of the parliament, and he ceases to be holding the office of prime minister,” Supreme Court Judge Ejaz Afzal said in court, according to the Reuters news agency.

Sharif — who, if he had remained in office until next year’s general elections, would have been the first prime minister in Pakistan’s history to complete a full term — found himself at the center of national controversy after the Panama Papers appeared to link his children to offshore companies used to purchase flats in an upmarket London neighborhood.

The allegations ended up in court following threats of street protests by Imran Khan, the former Pakistani cricketer turned opposition politician.

Sharif and his family deny any wrongdoing.

This was Sharif’s third stint as prime minister. The country’s top court previously stepped in to dismiss former leader Yusuf Raza Gilani in 2012, following a contempt of court case.

With the ruling, Sharif’s governing Pakistan Muslim League will be forced to choose an interim prime minister, as the nation prepares for next year’s national polls.

Get The Brief. Sign up to receive the top stories you need to know right now. Please enter a valid email address. Sign Up Now Check the box if you do not wish to receive promotional offers via email from TIME. You can unsubscribe at any time. By signing up you are agreeing to our Terms of Use and Privacy Policy . This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply. Thank you! For your security, we've sent a confirmation email to the address you entered. Click the link to confirm your subscription and begin receiving our newsletters. If you don't get the confirmation within 10 minutes, please check your spam folder.

Contact us at letters@time.com.