Original: George VI remained as King of Pakistan until his death in 1952 and his successor Elizabeth II was Queen of Pakistan until Pakistan became a republic on 23 March 1956.
Simplified: George VI remained as King of the United Kingdom and King of Pakistan until his death in 1952. Pakistan became a republic on 23 March 1956, so Elizabeth II was Queen of Pakistan for four years.