A supporter of ousted Pakistani prime minister Nawaz Sharif carries a party flag in Rawalpindi on July 29, 2017. (Aamir Qureishi/AFP/Getty Images)

ISLAMABAD, Pakistan — Former Pakistani prime minister Nawaz Sharif was found guilty of corruption Friday and sentenced to 10 years in prison, all but ending his political career and throwing his leaderless party into chaos less than three weeks before national elections.

Sharif’s adult daughter Maryam Nawaz was also found guilty in the same case, connected to illicit financing of family real estate properties overseas, and given a seven-year term. Both members of Pakistan’s leading political dynasty are in London, but they vowed to return and fight for justice.

“I promise I will continue this struggle until Pakistanis are free of the chains they are kept in for saying the truth” and “free of the slavery imposed on them by some generals and judges,” Sharif, 68, told a news conference in London on Friday evening. He said that if prison is the punishment for “demanding respect for the vote, I am coming to face it.”

The ruling by the National Accountability Court here was the latest blow to Sharif, the country’s once-popular leader and three-time premier. In April of last year, he was ousted as prime minister and barred from holding political office by Pakistan’s supreme court, following hearings on charges by political opponents that he and his family had illegally hidden their wealth in overseas business deals.

Commentators said Friday that Sharif’s Pakistan Muslim League-N party, which has no other charismatic leader, will have difficulty winning enough seats in Parliament to form a government and is likely to wind up in a weak coalition, facing challenges from the powerful security establishment and rising religious-based parties.

The accountability case grew out of the original supreme court corruption charges that the Sharif family had hidden its wealth in foreign properties, especially apartments in London. On Friday, the court also sentenced Maryam Nawaz’s husband, Muhammad Safdar, to a one-year term for failing to cooperate with the authorities.

The court ruled that Sharif and his daughter had participated in owning four apartments called Avendale Flats in an upscale London district. The family insisted that the apartments were purchased through legitimate financial resources, but prosecutors said they had been unable or unwilling to produce proof of those claims. The Sharifs are wealthy industrialists worth hundreds of millions of dollars.

Shortly after the ruling, Sharif’s younger brother Shahbaz Sharif, former chief minister of Punjab Province and current president of the Pakistan Muslim League-N party, rejected the verdict and said that legal actions and peaceful protests would be undertaken to challenge it. Speaking at a news conference in Lahore, he said that Nawaz Sharif had every intention of returning home and would not go into “self-exile.”

Nawaz Sharif and his daughter have been in London since June, where his wife Kulsum remains hospitalized with a serious illness after many months. Maryam Nawaz, known for feisty tweets and fierce loyalty to her father, tweeted Friday afternoon that “the real decision will be made on July 25,” when Pakistanis go to the polls.

“We are facing snakes hiding in the democratic system,” Nawaz tweeted, hinting that unnamed enemies in the military, judiciary and bureaucracy had sought to destroy Sharif. “Remember the faces of the conspirators and pawns on July 25.”

Later in the day, however, the National Election Commission barred her from running for Parliament in July. Shahbaz Sharif is also running for a seat and has not been charged with any crime, but he is a much less dynamic leader than his older brother and is not expected to carry the party strongly on his own.

The main challenger to the Muslim League is Imran Khan, 66, the former cricket star and powerful orator who heads a grass-roots pro-justice party and who brought the original allegations against Sharif to the high court. In recent months, numerous Muslim League candidates have defected amid the ongoing turmoil, and Khan’s party is expected to benefit.

Some analysts said that if Nawaz Sharif returns quickly to face the courts and a possible prison term, his party might benefit from a sympathy vote. But others said that no matter what the ex-premier does, the latest ruling has dealt a final and fatal blow to his political career and ability to rally public support.

“He is in trouble and there are more troubled times ahead for him,” said Rasul Bakhsh Rais, an analyst in Lahore. Rais said Sharif and his daughter had made a mistake by “opting for confrontation with the military and judiciary” after his ouster last year, leading to “polarization and instability across the country. They are still in confrontation mode, and that will add to political instability.”

The Muslim League launched its election campaign on Thursday, taking out full-page newspaper ads with a populist manifesto that vowed to help the poor, create jobs, improve health care and access to water, and promote the rights of women and minorities. It was a sharp departure from the party’s focus on large infrastructure and public works.

But news of the kickoff, announced formally by Shahbaz Sharif, was swept aside by blanket media coverage and fervid speculation on the court ruling and its likely impact on the upcoming election. The Muslim League-N has led the country three times with Nawaz Sharif as prime minister, but each time his tenure was cut short by military intervention or other problems.

Shaiq Hussain in Islamabad contributed to this report.

Read more:

Islamist terrorism wanes in Pakistan, but religious fervor threatens national unity

In glistening new airport, Pakistan sees ticket to reviving the country’s prestige

In Pakistan, a young Pashtun man was killed by police. Another has risen to lead a movement.