A Tory donor ennobled by David Cameron last week had handed over £300,000 to the party just two months before, it has emerged.

Figures released by the Electoral Commission reveal that the city financier Michael Farmer was the Tories’ third biggest donor between April and June. In total Sir Michael has given the Conservatives more than £6m.

Details of donations made the main parties show that in the second quarter of 2014 the Tories moved further ahead of Labour in the fundraising stakes, raking in £7.18m. More than a third of that came from just 10 donors.

Labour continued to rely heavily on union backing, receiving £1.31m from the unions in the second quarter of the year from total declarable donations of £3.76m.

But there was good news for the party in Pendle – a constituency high on Labour’s target list in 2015. The local party accepted nearly £250,000 through the will of an elderly resident who died last year.

For the first time Ukip got more private funding than the Liberal Democrats thanks mainly to a £1m donation from a company controlled by Paul Sykes, who helped bankroll Ukip’s successful European election campaign. Donations for the period came to £1.4m, putting the party ahead of the Liberal Democrats (£1.23m) and the Scottish National Party (£1.14m).

The figures showed that one of the biggest individual donations was the £629,570 given to Labour by the property magnate Sir David Garrard. The Tories’ two largest donations were each of £500,000 – both from people who had not previously given large sums to the party.

Labour said the figures showed another £2m had been raised by the Tories from donors who attended private dinners with David Cameron and other senior ministers – taking the party’s total to £5m this year.

Jonathan Ashworth, the shadow Cabinet Office minister, said: “When millions are flowing in from hedge funds and exclusive groups of donors, is it any wonder David Cameron stands up for the privileged few?

“Millionaires and hedge funds have been given a tax cut while hardworking families suffer from a cost-of-living crisis. David Cameron is leading an out-of-touch, hollowed-out party which has no answers to the major challenges our country faces.”

Referring to Labour’s union donations since Ed Miliband became leader, Grant Shapps, the Tory party chairman, said: “The figures are jaw-dropping… Union bosses like Len McCluskey have siphoned off £34m from members’ pay packets, and funnelled it into Labour’s election war chest.

“And we all know what payback they want from weak Ed Miliband: more wasteful spending, more taxes, and more debt than our children could ever hope to repay.”