Former Prime Minister Imran Khan was arrested on Saturday after a trial court sentenced him to three years in prison, a verdict that will most likely end his chances to contest upcoming general elections.

Mr. Khan was taken into custody by the police from his home in the eastern city of Lahore soon after the court decision was announced in Islamabad.

He was found guilty of hiding assets after illegally selling state gifts.

“The allegations against Mr. Khan are proven,” said Humayun Dilawar, the judge who announced the verdict in Islamabad, Pakistan’s capital. The court also imposed a fine of around $355.

The case is related to an inquiry by the country’s election commission, which found last October that Mr. Khan had illegally sold gifts given to him by other countries when he was prime minister and concealed the profits from the authorities.

Mr. Khan has denied any wrongdoing.

He and his lawyers had accused the judge of bias and sought to have the case transferred to another judge. They are likely to appeal.

In a statement, Mr. Khan’s political party, Pakistan Tehreek-e-Insaf, rejected the verdict, calling it “the worst example of political revenge.”

But governing coalition members hailed the outcome. Attaullah Tarar, a leader of Pakistan Muslim League-Nawaz, said, “Imran Khan will have to pay for his corrupt practices and cannot escape justice.”

Mr. Khan, who is facing an array of court cases, was briefly arrested earlier in the year in a different case. That arrest set off violent protests across the country, as well as attacks on military installations.

Since then the country’s establishment has staged an extensive crackdown, arresting several prominent members of Mr. Khan’s party. A large number of the party’s leaders have also defected; some are in hiding.

Mr. Khan was removed from power last year after a no-confidence vote in Parliament. Since then, he has led a powerful political movement and has accused the military of being behind his ouster, a charge it has denied.

The police in several cities have been put on alert after Mr. Khan’s arrest in case his supporters take to the streets.