Labour has selected the head teacher at Gordon Brown's old school to fight the forthcoming Glenrothes by-election.
Lindsay Roy, the 59-year-old rector of Kirkcaldy High School, was selected by local party constituency members.
Labour is defending a majority of more than 10,000 in the Westminster seat, left vacant by the death of MP John MacDougall.
No date has yet been set for the by-election but it is thought the contest will be at the end of October.
Mr Roy was up for the nomination against Colin Davidson, a teacher at Bell Baxter High School, in Cupar, and Kezia Dugdale, who works for Labour MSP Lord Foulkes.
He is a former head teacher at Inverkeithing High School and also served as president of the Headteachers' Association of Scotland.
Mr Roy said: "I am delighted and honoured to be selected to fight this seat.
"I will work hard for every vote because I have seen myself the huge difference that Labour has made to our communities in Fife."
Mr MacDougall died in August while battling mesothelioma, an incurable asbestos-related cancer of the lungs.
• Peter Grant, the leader of Fife Council, is standing for the SNP. The Liberal Democrats have selected businessman Harry Wills and environmental campaign manager Maurice Golden is standing for the Conservatives.