ISLAMABAD, Pakistan — The Pakistani Supreme Court on Wednesday withdrew a travel ban imposed on the former military ruler Pervez Musharraf, paving the way for him to seek medical treatment abroad even as he awaits trial on treason charges.

Mr. Musharraf is accused of subverting the Constitution in late 2007 when he declared emergency rule and fired almost all the senior judiciary, and he faces the possibility of a death sentence if convicted.

The case has caused a major rift between the civilian government of Prime Minister Nawaz Sharif, who was deposed by the coup that brought Mr. Musharraf to power in 1999, and the powerful military establishment, which has been wary of having its former chief put on trial. No one who once led the army had been the target of criminal prosecution before Mr. Musharraf.

On Wednesday, a five-member bench of the Supreme Court, overseen by Chief Justice Anwar Zaheer Jamali, turned down an appeal by the federal government of a lower-court ruling that lifted the travel restrictions, which have been in effect since 2013. However, the court noted that the government would be allowed to take additional legal measures that could restrict or regulate Mr. Musharraf’s movements.