After 16 hours of debating and deal-making, the Texas House of Representatives passed the state budget just before 2 a.m. Friday. 

Earlier this week, the Texas Senate passed Senate Bill 1, which is their version of the budget. Representatives then began the process of amending it Thursday before passage through the House. At the start of Thursday, about 400 amendments to the budget bill had been filed. Several more were added as the day went on.

The final amendment adopted before the House approved the budget came in the form of a deal struck between lawmakers. Earlier in the day, Rep. Valoree Swanson presented an amendment similar to the senate's "bathroom bill" that would prohibit transgender Texans from using the restrooms of their choice in certain circumstances.

She agreed to remove that amendment in exchange for a vote to remove state funding from groups that provide abortions, Planned Parenthood being one of them. That passed by a vote of 101 to 43.

Another amendment, filed by Rep. Celia Israel (D-Austin), would prohibit using state money to build a border wall in Big Bend State Park.

In their version of the budget, the House wants to use $2.5 billion dollars from the state's rainy day fund. The total fund is scheduled to end the year with $10.4 billion dollars. The Senate has previously stated they do not want to tap into the rainy day fund.

Rep. Larry Gonzales from Round Rock is on the Appropriations Committee and agrees the money should be used. 

"We're saying there's a fund that was created and approved by the taxpayers to prevent steep dips in our economy and that and that's what the Economic Stabilization fund is for and that is how it's being spent," said Gonzales. 

Israel agreed.

"It's not a holy purse, we can touch it, it's our money, so I'm proud of the House for at least saying that," said Israel. 

The House ultimately voted in favor of using $2.5 billion from the rainy day fund.

The House also aimed to give $1.5 billion dollars in additional funding to public education, $500 million to Retired Teacher's Healthcare, and almost $450 million to Child Protective Services and the Texas Foster Care system. 

The last part is with the help of one of the amendments that passed Thursday from Rep. Ina Minjarez. It would move $10.5 million dollars each year from the Attorney General's office to CPS and Foster Care. Minjarez's office tells KVUE that would help full fund the request of $1.18 billion dollars from DFPS for 2018 in order to be successful. 

"I always say budgets are moral documents so, so far we've been able to secure more funding for CPS that's clearly an emergency issue and we've been able to stay away from fights around bathrooms which is not an emergency issue," said Israel. 

House representatives also voted to strip Gov. Greg Abbott's Texas Enterprise Fund -- which offers incentives to companies doing business in Texas -- of its $43 million and divvy it up between CPS and certain services in Medicaid.

Another amendment that passed was from Rep. Abel Herrero from Corpus Christi. His amendment took aim at the possibility of school vouchers. It would not allow any state money to go toward "a school choice program," or be used to support a "school voucher, education savings account, or tax credit scholarship program or similar program through which a child may use state money for a non-public education."

"I believe that with this vote we were able to send a resounding message that the house stands strongly with their neighborhood schools and our public school teachers and that any sort of scheme as a voucher or otherwise to siphon public funds away from schools is not something the house will support," said Herrero. 

The proposed House budget also included cuts of about $2.4 billion to Medicaid.

Gonzales says they're working with a smaller amount of money for this budget. 

"This session is very different than last session. Last session we had some extra money from oil and gas and high sales tax, we were going well, not the case this time, this one's different in that you have to prioritize kind of what the needs are, understanding that it's going to be a little rough," said Gonzales. 

House representatives passed the budget by a vote of 131-16.

Debate would have lasted even longer – had several amendments not been cut off and instead added to the "wish list." The budget now goes to a conference committee – where members of the House and Senate will negotiate to a final version.

Constitutionally, the only thing the legislature is required to do each session is pass a budget.

Reporter Christy Millweard live-tweeted the first part of the day from the Capitol. You can follow the progress here: