The Labour leader was struck on the head and shoulder when a man in the crowd hurled a volley of eggs at him.
The man, wearing a fluorescent jacket, was seized by security officers at the East Street market in Elephant and Castle, south London, and bundled away.
At least one journalist in the large media party following Mr Miliband also took a direct hit, while others were splattered with egg.
The Labour leader appeared unperturbed by the attack – carrying on with his visit, chatting to shoppers and stallholders.
“This is not the first time it’s happened to me. I’m sure it’s not the last,” he said. “I’m always looking for new ways to connect with the voters.”
Posting on Twitter, he later wrote: “Thanks to all at East St Market for the warm welcome today. Can recommend it for easy availability of eggs.”
As he was led away, the man, who gave his name as Dean Porter, told reporters it had been an “opportunistic moment”.
“They should stop giving favouritism to the banks. They do nothing. The government do nothing. The shadow government do nothing,” he said. “I don’t believe him at all. If you are poor, you are considered a burden. All they care about is the banks.”
The incident had echoes of the 2001 election campaign when John Prescott was visiting Rhyl in North Wales and was hit by an egg thrown by a farmer – who Mr Prescott then punched.
While Mr Miliband brushed off the incident, he could not avoid questions about the growing murmuring within his own ranks over his leadership and the slide in Labour’s opinion poll lead over the Conservatives.
He rejected complaints that the party had failed to make any impact over the summer, insisting he was taking the fight to the coalition over what he called the “cost of living crisis” and offering a “comprehensive alternative” on the economy.
He bluntly dismissed shadow health secretary Andy Burnham’s warning that the party’s message was not getting through and that it was running out of time to make an impact before 2015’s general election.
“I don’t accept that,” he said. “What Andy is saying – and Andy is doing a very good job in taking the fight to the government on the health service and the crisis in A&E – is that what we are doing as a Labour Party is setting out how we would change the country.”
Scotland Yard said Mr Miliband did not want police to take the matter further.