 Miliband was elected to Parliament in 2005 , succeeding the retiring Labour MP Kevin Hughes in Doncaster North . Prime Minister Tony Blair made Miliband Parliamentary Secretary to the Cabinet Office in May 2006 and when Gordon Brown became Prime Minister in 2007 , he appointed Miliband Minister for the Cabinet Office and Chancellor of the Duchy of Lancaster . Miliband was subsequently promoted to the new post of Secretary of State for Energy and Climate Change , a position he held from 2008 to 2010 . 
