Thornberry was first elected to Parliament in 2005 and served as Shadow Attorney General in Ed Miliband's shadow cabinet from 2011 until she resigned in 2014 after sending a tweet that was described as "snobby". After Jeremy Corbyn won the 2015 leadership election, she was appointed Shadow Employment Minister in September 2015, Shadow Defence Secretary in January 2016 and Shadow Foreign Secretary in June 2016. She was a candidate to succeed Corbyn as Leader of the Labour Party in the 2020 leadership election but was eliminated from the race after failing to obtain the number of nominations needed.