London, England (CNN) -- Britain's Labour Party on Saturday announced Ed Miliband as its new leader Saturday, four months after Prime Minister Gordon Brown resigned from the post when his party lost the election.
Several rounds of voting were required to determine Saturday's winner, since no one received more than 50 percent support in the early ballots.
Ed Miliband and his brother, David, who was also in the running, were locked in a battle for the top spot for until the very end. The final numbers gave Ed 50.6 percent of the votes and David 49.35 percent.
"Today a new generation has stepped forward to change our party," Ed Miliband said upon the announcement. "We are united in our mission to transform Labour so that, once again, we stand up for the hardworking majority who play by the rules and want a less divided and more prosperous Britain. I know we have a lot of work to do. The journey starts today."
David Miliband served as foreign secretary under Brown. The Milibands faced competition from former Brown cabinet members Ed Balls and Andy Burnham, and London parliament member Diane Abbott.
Ed Miliband will now lead the opposition to the current coalition government, led by Prime Minister David Cameron, of the Conservative Party, and Deputy Prime Minister Nick Clegg, of the Liberal Democrats.
"I will oppose this coalition when it is doing the wrong thing, but I will support them when they are doing the right thing, and that is responsible politics and it the politics people in this country want," Miliband said.
Harriet Harman has been acting Labour leader since Brown left.
Miliband will make his first major speech at the annual Labour Party conference, which opens in Manchester, England, on Sunday.
Miliband studied at Oxford and the London School of Economics, and was elected to parliament five years ago. He then held a string of Cabinet positions, most recently secretary of state for energy and climate change, and served as Labour's spokesman on those issues.
His brother, Oxford-educated David Miliband, was one of the first to enter the race for Labour leader. He wrote the party's manifesto that helped it win the election in 1997, and was elected to parliament in 2001. He became foreign secretary in 2007.
Balls was also elected five years ago and served as Labour's secretary of state for children, schools and families until the party's election defeat. A labor union member, he studied at Oxford and Harvard universities, and has been a columnist for several newspapers including the Financial Times and The Guardian.
Burnham has served in Parliament since 2001, but has been attending Labour Party meetings since he was 14, a year before he was allowed to join. He attended Cambridge and was most recently the government's health secretary.
Abbott is another longtime party member and has been a member of Parliament the longest of any of the candidates -- since 1987, when she became Britain's first black female MP. She started as a grassroots Labour activist 30 years ago after attending Cambridge and was one of the few Labour MPs to vote against the Iraq war.
CNN's Melissa Gray contributed to this report.