ISLAMABAD, Pakistan — A Pakistani high court on Monday overturned a death sentence that was handed down to Pervez Musharraf in a treason trial last month, most likely putting an end to the legal case against the country’s former military dictator.

Monday’s ruling, by a three-member bench of the High Court, found that the special court that issued the sentence was unconstitutional. Several lawyers and analysts said that the current government, which includes many Musharraf loyalists, was unlikely to reconstitute the special court for a new trial.

The three judges, in the eastern city of Lahore, said that the case against Mr. Musharraf was politically motivated and that the crimes he was accused of committing — high treason and subverting the Constitution — were “a joint offense” that “cannot be undertaken by a single person.”

Mr. Musharraf, 76, was accused of subverting the country’s Constitution in 2007 when he fired much of the judiciary and imposed a state of emergency in an attempt to block a political opposition movement. The movement had greatly weakened him, and he resigned the following year under a threat of impeachment.