ED Miliband has been branded a hypocrite by George Osborne, who called on the Labour leader to hand back up to £1.5 million of tax estimated to have been avoided on a party donation.

The tax row overshadowed Mr Miliband's keynote speech on welfare, in which he pledged to "remake social security" in the UK, introduce a cap on welfare, build more houses, tackle low pay and recognise contributions so that someone who has paid in for many years will receive more in benefits than those who have not.

The Labour leader also insisted his party had to be "realistic about what we can afford" if elected to government, and confirmed it would not reverse the Coalition's scrapping of child benefit for high earners, a policy he once denigrated.

Iain Duncan Smith, the Work and Pensions Secretary, branded the speech vacuous, adding: "Having got us into this mess, the speech told us nothing about how he would get us out."

The tax row meant Mr Miliband appeared on the back foot for the second day running.

Businessman John Mills said it was "tax-efficient" for him to donate shares in his shopping channel company JML because simply giving cash would have meant the UK Government would have taken half of it.

The former councillor, who is the brother-in-law of former Labour Cabinet minister Tessa Jowell, admitted: "It came out of a discussion I had with them [Labour] about the best way of doing it."

Accountants estimated Mr Mills would have paid nearly £1.5m in tax if he had given the party the £1.64m donation out of his earnings. The gift was effectively the largest to Labour in the first quarter of this year, and twice that of the Unite union.

Answering questions following his welfare speech in London, Mr Miliband said: "The reason John Mills gave us these shares is because he wanted the Labour Party to have a steady stream of income, which we will get from dividends."

He pointed out "lots and lots of organisations" received donations in this way, but it is thought this is the first time a political party has done so. Mr Miliband made clear Labour would pay tax every year on the dividends. "We are not avoiding tax – we are paying tax," he stressed.

The Tories said the Labour leader was defending the practice of avoiding paying full tax, which was "directly at odds" with his recent criticism of Internet giant Google's tax arrangements

In a letter to Mr Miliband, Mr Osborne wrote: "Most importantly, will you now pass the amount of tax that has been avoided to the Exchequer?"

During a visit in central London, the Chancellor was scathing, saying: "Ed Miliband is practising the complete opposite of what he preaches.

"He's gone around recently lecturing people about paying their taxes – now it emerges that his own office is advising Labour donors on how to avoid taxes.

"The truth is that if people don't pay their taxes, then it is difficult to fund our NHS and our schools, and what he is doing is completely wrong."

In the House of Lords during a debate on tax evasion and avoidance, Lord Foulkes, the former Scotland Office Minister, attacked tax dodgers.

He said: "Those who dodge their legitimate tax obligation commit a severe moral breach but they also deprive our schools and our hospitals of much-needed investment and create problems for responsible businesses who pay their fair share of taxation."