A Pakistani court on Friday sentenced ousted Prime Minister Nawaz Sharif to 10 years in prison over his family’s purchase of upscale London flats, in a major blow to his party ahead of a general election on July 25.

The guilty verdict in absentia against Sharif, 68, threatens to end the career of one of Pakistan’s most high-profile politicians of the last four decades, a political survivor who was prime minister three times.

A political ally said Sharif would return to Pakistan from London to file an appeal, facing arrest on arrival just before the election, in which his party is in a close race with opposition figure Imran Khan’s party.

“Today’s verdict shows that the Avenfield apartments were purchased using corruption money,” prosecution lawyer Sardar Muzaffar Abbasi told reporters, citing the name of the apartment building in London.

“Sharif’s daughter, Maryam Sharif, widely seen as his chosen political heir, was sentenced to seven years in prison.

The conviction means Maryam will be disqualified from contesting in the elections.

“The people of Pakistan and PML-N reject this decision,” said Sharif’s brother Shehbaz, who took over as PML-N president after his brother was banned for life from holding office, and is expected to be its prime ministerial candidate.

“This decision is based on injustice.”

Both Sharif and his daughter were in London on Friday with Sharif’s wife, Kulsoom, who is being treated there for cancer and is in coma after suffering a heart attack last month.

“They both denied wrongdoing and will appeal the decision,” Sharif’s ally Tariq Fazal Chaudhry said. He added that the former premier will return to Pakistan before the July 25 election.

The National Accountability Bureau (NAB) court accused Sharif and his family of money laundering and being unable to legitimately show the money trail for the purchase of several luxurious properties in London, mostly in the mid-1990s.