Answer
Kārlis Ulmanis served as the Prime Minister of Latvia until 1940, a total of 15 years, holding the position twice, from 1918-1921 and from 1934-1940. He played a pivotal role in Latvia's independence and its initial development, leading the nation through significant historical events and shaping its political landscape during his time in office.