23/06/2017 10:41 AM AEST | Updated 23/06/2017 11:32 AM AEST

Gonski Schools Package Finally Passes After Marathon Senate Sitting

$23 billion in funding became law at 2am.

After months of negotiating, and a frenzied few days trying to lock in enough Senate support, the Government's landmark $23.5 billion schools funding package has finally passed into law after another late night in Parliament House.

The legislation, dubbed Gonski 2.0, was spruiked by Prime Minister Malcolm Turnbull on Friday as "the biggest reform in Commonwealth school funding ever". A new funding system will push schools onto what is called a 'needs-based' formula, aimed at ensuring students in different schools receive the same level of government support.

"National, consistent, needs-based funding right across the country," Turnbull said.

"Labor had 27 separate deals, contradictory, the same school with the same needs in the same state getting radically different treatment. It was unfair. It couldn't be justified. What we are delivering is fair, consistent needs-based funding. Now, now that we've got the funding model right, the next step is to make sure we get the great educational outcomes."

It took until the last day of the current parliamentary sitting session, and later, to get the deal through the Senate. Labor, plus several teachers' unions and education groups, opposed the reforms, claiming the funding formula was unfair and did not measure up to the deal they wanted for schools. It meant the Coalition needed the support of the Greens, or nearly all the diverse members on the unpredictable Senate crossbench, to get the Gonski reforms through -- and it became quite a mess as the Government tried to woo both potential partners.

In the end, despite winning a few more concessions including an extra $5 billion added to the package, the Greens opposed it. The Government managed to lock in 10 of the Senate crossbenchers, giving it enough votes to get the funding reform over the line. Even still, after a long few days of debate and procedural delay, it took until 2am on Friday morning -- almost ten hours after the Senate would usually rise on a Thursday evening -- for the Gonski bill to pass.

Education minister Simon Birmingham tweeted in celebration of the passage of the legislation at 2.05am. On Friday morning, he joined the PM to talk up the benefits of the new funding.

"We put the bucks in place, how do we get the best bang for our bucks? How do we make sure in Australian schools the money is used as effectively as possible on evidence-based measures to help students be their best, to help every school achieve the best for their kids," Birmingham said in Canberra.

Click below to follow HuffPost Australia Politics on Facebook!