When Sanna Marin, 34, was sworn into office on Tuesday, she became the world’s youngest prime minister, a fact that drew international attention this week when her party elected her as Finland’s next leader.

But while the world is just becoming acquainted with the new, left-leaning leader, Ms. Marin has been a rising star in Finland’s Social Democratic Party since first entering Parliament in 2015. For many, she was a natural choice for her new role.

“She doesn’t come out of nowhere,” said Johanna Kantola, a professor of gender studies at Finland’s Tampere University. “And she is quite well-liked.”

Ms. Marin was voted in by her party after a turbulent week in which Prime Minister Antti Rinne resigned over criticism from within his coalition government of the handling of a postal workers’ strike. Mr. Rinne will continue as chief of the Social Democrats.