Answer
The longest-serving Prime Minister of Canada was William Lyon Mackenzie King, who held office for a total of 21 years, 154 days, over three non-consecutive terms from 1921 to 1930, 1935 to 1948, and 1926 to 1926. King's tenure was marked by significant events such as the Great Depression and World War II, during which he played a key role in shaping Canada's domestic and international policies.