British India became independent in 1947. It was then immediately partitioned into India and Pakistan. Pakistan was effectively in two pieces, West Pakistan and East Pakistan either side of the current State of India. East Pakistan seceded in 1971 to become Bangladesh.
So, it was either in 1947 or 1971 depending when you believe "modern" (I use the word with a degree of circumspection) Pakistan came into existence.