The Abbott government has been dealt a major blow after the repeal of the mining tax was defeated in the Senate.

The tax will survive at least until Parliament next sits on August 26 after Labor, the Greens and crossbench senators used their numbers to stop the government abolishing the tax and the approximately $10 billion in spending linked to it.

Greens Senator Peter Whish-Wilson speaks in the Senate against the repeal of the mining tax. Credit:Alex Ellinghausen

The next instalment of the mining tax is due to be paid by companies by July 21st.

The Palmer United Party, Labor and the Greens had been pushing amendments to the repeal bill that would preserve spending funded by the tax including the Schoolkids Bonus, low income superannuation contribution and the income support bonus.