The Labour Party leader was in Southampton just hours after his party dramatically swept back into power in the city.
He told assembled supporters the result proved their party is back on track in southern England after years in the local government wilderness.
But as the senior politician was giving media interviews after his public address, he was approached by a man in a black hat who firmly planted his hand on his right shoulder with a telltale splat.
As the man quickly ran off down the road, a bemused Mr Miliband looked down to see bright yellow yolk dripping down his suit.
An aide swiftly intervened to take off the jacket and the Leader of the Opposition laughed it off before continuing his interview in shirt and tie.
Shortly afterwards, he ended his talk and immediately headed to a waiting car.
But the 42-year-old was keen to remain light-hearted about the incident, and last night posted on his Twitter site: “For those wondering about egg’s origins, fairly sure it wasn’t free range, but nothing can take away from cracking result in Southampton.”
Speaking before the egg attack, Mr Miliband had described Cllr Richard Williams as a “fantastic” leader of Southampton's Labour Party. He pledged to repay the voters’ trust by working on the issues that matter most to people: jobs, housing and public services.
Mr Miliband said: “The reason why we won in Southampton is because we have been running a campaign about people's priorities.
“A campaign which Richard has led around jobs, around housing, around public services and around the things that matter to people.
“Here in Southampton, it's a rejection of the economic failure of this Government and the unfairness of this Government.
“People are understanding Labour understands the struggles you are going through. Labour is back in the south of England. Labour will keep these promises.”
Cllr Williams said he was delighted his party leader had chosen the city to celebrate Labour’s local election gains.
He said: “He’s been remarkably positive throughout the campaign, and it’s not just been his physical presence here. What he wants to do with the party is connect with people, and that’s what we’re trying to do down here, and that’s how we will make a difference.”
Labour election win leaves city without a mayor - click here