Geoffrey D. Langlands, a British officer who stayed in Pakistan after his military service ended and became one of the country’s most celebrated educators, died on Wednesday at a hospital in Lahore. He was 101.
His death was confirmed by Aitchison College, Pakistan’s most prestigious boarding school, in Lahore. Mr. Langlands spent 25 years there as a teacher and later a headmaster.
In more than six decades of teaching mathematics and English, sometimes in regions rife with violence, Mr. Langlands, commonly known as “the Major,” guided the children of Pakistan’s elite to top careers. His students included Zafarullah Khan Jamali, a former prime minister, and Imran Khan, the current prime minister.
“He stood out,” Mr. Khan said of Mr. Langlands, the subject of a Saturday Profile in The New York Times in 2012. “He had this mixture of being firm yet compassionate.”
Mr. Langlands and his twin brother, John Alexander Langlands, were born in Yorkshire, England, in 1917. His father died in the worldwide flu epidemic of 1918, and his mother, a folk dancer, died of cancer in 1930. His grandparents assumed custody, only for his grandfather to die a year later.
Mr. Langlands taught science and mathematics in London before enlisting in the British Army in 1939 as World War II began. He fought in a commando unit in France.
In 1944, he joined the British Indian Army and was posted in Bangalore, where he was put in charge of recruiting and training young officers. He survived an attack by Muslim gunmen while on a train with Hindu refugees in 1947.
Mr. Langlands then spent six years as an instructor in the Pakistani Army. Mohammad Ayub Khan, who became Pakistan’s president in 1958, asked him to stay in the country, and he accepted a job teaching algebra at Aitchison College.
In 1979, Mr. Langlands moved to the North Waziristan region to become the principal of Cadet College Razmak, a military high school. Tribesmen there held him hostage for six days in 1988.
“It wasn’t so bad,” he said in 2012. “They were very polite once they found out I was 71. And before I left, they insisted on having their photo taken with me.”
He moved to Chitral a year later and became the headmaster of Sayurj Public School, which was later renamed Langlands School and College. He taught there until 2012, when he was 94, and was considered a key member of the community.
“The major is invaluable,” Sultan Mehmood, a local development worker, said in 2012. “We cannot replace him.”
Mr. Langlands lived in a cottage and paid himself a paltry salary. His servant appeared each morning with the exact same breakfast: oatmeal, a poached egg and two cups of tea. Mr. Langlands kept photos of his famous visitors, including Diana, Princess of Wales, who came to Chitral in 1991.
In his last years, Mr. Langlands, who never married, lived in an apartment on the grounds of Aitchison College, accommodations that had been arranged by his former students.