Steel-helmeted troops patrolled the streets here today after a narrow majority of Pakistan's supreme court judges ruled that deposed Prime Minister Zulfikar Ali Bhutto should be hanged.

After hearing a radio report of the judgment, Bhutto's wife, the Begum Nusrat Bhutto, escaped from house arrest in Islamabad, 10 miles away, and drove to visit her husband in Rawalpindi jail, going through a police roadblock at high speed.

She was allowed to see her husband before prison authorities were informed of her escape. She was then ordered to leave. When she tried to get back into her own car, police officers reportedly manhandled her, twisting her wrists, and forced her into a police jeep. She was taken back to Islamabad, where she was held with her daughter Benazir, 25.

Hundreds of Bhutto's supporters have been jailed in recent days and schools and colleges closed in an effort to block violent reactions to the court's decision. Most government buildings were under the guard of troops.

Bhutto, 51, may have just over a month to live. Any petitions for mercy must be lodged by the middle of next week with Gen. Zia ul-Haq, the man who ousted him in a coup in 1972. At the same time, the supreme court is awaiting a petition from Bhutto's lawyers asking the judges to review their decision. Thirty days are allowed for this.

Bhutto's counsel, Yahya Bakhtiar, said the deposed prime minister took news of the judgment calmly.

The court, which voted four to three to uphold the sentence, also endorsed death sentences for three codefendants. The three were members of Bhutto's security police.

The four judges who upheld the sentences were from the Punjab. They included the chief justice, Anwar-ul Haq.The dissenters were from the other three provinces of Pakistan.

Even before the voluminous judgments -- running to more than 2,000 pages -- were available, Bhutto supporters were claiming that the decision reflected provincial tensions and rivalries in Pakistan: Punjabis against the rest. Bhutto, who is still widely regarded here as a man of common people, was born in the province of Sind.