When U.K. Justice Secretary Michael Gove announced Thursday that he would run for prime minister, the move quickly ended the run of London Mayor Boris Johnson, whom Gove had previously supported for the leadership of the Conservative Party.

Current U.K. Prime Minister David Cameron announced Friday that he would resign, after a slim majority of voters in a referendum Thursday said they wanted to leave the European Union.

Gove’s decision led to a sudden shakeup for the Tories, but it also constituted a complete turnaround for the two men, whose acquaintance began decades ago at Oxford University. And for Gove himself, it was the next episode of an unusually varied, dynamic life.

Gove, 48, was born in Edinburgh, adopted and raised in Aberdeen by a father who ran a fish-processing business and a mother who was a lab assistant at Aberdeen University. He attended Oxford University, and after graduating, worked in Aberdeen as a reporter for the Press and Journal.

He later worked for the BBC as a reporter and the Times of London as an assistant editor.

In 2005, Gove became Shadow Minister for Housing. He became Shadow Secretary of State for Children, Schools and Families in 2007, before being appointed Secretary of State for Education in May 2010, according to the U.K.’s government website

Gove, on his personal website, described himself as “passionately committed to raising standards in state schools and helping children from less privileged backgrounds to maximize their potential.”

In May 2015, Gove was appointed Lord Chancellor and Secretary of State for Justice. This year, Gove supported Johnson this year in the Vote Leave campaign as it made the case for Britain to split from the European Union.

But on Thursday, Gove suddenly changed course. Acknowledging in a statement, “I wanted to help build a team behind Boris Johnson so that a politician who argued for leaving the European Union could lead us to a better future,” he said that he had “come, reluctantly, to the conclusion that Boris cannot provide the leadership or build the team for the task ahead. I have, therefore, decided to put my name forward for the leadership.”

Thirty years ago, Gove supported Johnson when he campaigned, successfully, to become president of the Oxford Union, the Financial Times reported.

But Gove has not always referred to the dynamic between him and Johnson in a flattering light. “I was Boris’s stooge. I became a votary of the Boris cult,” Gove wrote in 2005.