"Britain needs a Labour party that can rebuild after this defeat so we can have a government that stands up for working people again. And now it's time for someone else to take forward the leadership of this party," Miliband said in his public address.
Labour's deputy leader Harriet Harman will serve as interim leader.
The Conservatives have won 326 seats in the 650-seat House of Commons, while Labour garnered only 230, losing 26 constituencies. Only seven constituencies are yet to declare their election results.
Ed Miliband became the leader of the party in September 2010, after the party lost the general election and then-Prime Minister and Labour leader Gordon Brown resigned.