A military officer throughout her working life , she was the longest-serving British commander of the Royal Navy in the 20th century , and the first woman to have held the position .
Margaret Thatcher was a prime minister .