Previously, during his public service, Andrzej Duda was among others an Undersecretary of State at the Ministry of Justice in the years 2006–2007. Following that appointment, from 2008 to 2010, he served as an Undersecretary of State in the Chancellery of the late President Lech Kaczyński. He became a member of the Sejm, the lower House of Parliament, after the 2011 parliamentary elections, when he received 79,981 votes for the Kraków constituency as a candidate of the Law and Justice party. In the May 2014 ballot, he was elected as MEP with 97 996 votes.
Andrzej Duda ran in the May 2015 presidential election as a candidate of the Law and Justice party. In the first round of voting, he achieved the best result of all candidates 34.76% of the vote. In the runoff, he obtained 51.55% of the valid votes (8 630 627 votes) and became the President of the Republic of Poland. On 26 May 2015, Duda, as president-elect, resigned from his membership in the Law and Justice party.
In 2020 President Andrzej Duda successfully ran for re-election. He received 51,03% of total votes (10 440 648 votes) with a nearly 70% voter turnout (20 636 635 votes). On August 6, 2020 he was sworn in office for a second term.
Before moving into public service and politics President Andrzej Duda was a researcher and lecturer at the Department of Administrative Law at the Jagiellonian University. In 2005 he earned his PhD in law from the Jagiellonian University.