When he was born on January 21, 1829 in Stockholm, Oscar Fredrik was created Duke of Östergötland. He entered the navy at the age of eleven, and was appointed junior lieutenant in July 1845. Later he studied at Uppsala University, where he distinguished himself in mathematics. On 13 December 1848, he was made an honorary member of the Royal Swedish Academy of Sciences.