The passage of the $52.1 billion budget and the levy bill capped off a busy evening at the state Capitol, as lawmakers concluded their 105-day session.

Also on Sunday, both chambers of the Legislature approved Initiative 1000, which reverses a state ban on affirmative action.

During the debate on I-1000, a handful of opponents in the Capitol building yelled, "Let people vote," to urge legislators to instead send the measure to the November ballot.

Lawmakers, however, opted to pass the initiative themselves, which means it is set to become law without going to voters this fall.

"This means the theoretical words we say all the time — about fairness and access for all — become more of a reality," said state Rep. Lillian Ortiz-Self, D-Mukilteo.

A flurry of overnight votes took place on Friday and Saturday leading up to the Legislature's Sunday adjournment. Even so, at several points it looked as if lawmakers still might not finish on time, due to a debate that came to a head over the so-called “levy lift” bill.

School districts had urged the Legislature to relax limits on local school district property-tax levies, which lawmakers approved as part of a landmark school-funding overhaul two years ago. Many districts said that if the limits stayed in place, they wouldn't have enough money to meet all their needs.

Talks dragged on Sunday, with the main disagreement centering on language adopted in the Senate that would send some state funding to charter schools.

Legislative leaders ultimately struck a deal to pass the levy bill that involved stripping out the charter-school language. The compromise also meant adopting stricter accountability measures to try to ensure local levy money doesn't pay for basic education, which is the state's responsibility. Additionally, lawmakers passed legislation to restrict the release of information about people participating in the state's bump-stock buyback program, something Republicans asked for.

One of the things that died in the Legislature, however, was a tax on capital gains, which would have affected profits from selling stock and bonds.

Both the House and Senate — each with healthy Democratic majorities — floated versions of a capital-gains tax this year. But the tax, which opponents have decried as an unconstitutional tax on income, failed to make it into the final budget deal.

Senate Democrats had originally suggested using capital-gains tax revenue to reduce taxes elsewhere, separately from their main budget. But with the clock ticking on Sunday, Senate Majority Leader Andy Billig, D-Spokane, said there wasn’t enough support for that type of tax-relief plan.

The $52.1 billion budget agreement that Senate and House leaders passed Sunday now heads to Gov. Jay Inslee's desk.

Once signed into law, it will begin to reform the state’s mental health system — in part by establishing more options for treating people in their communities, rather than at the troubled Western State Hospital in Lakewood. The two-year spending plan also will finish the phase-in of the state’s plan to fully fund public schools, which the Legislature approved in 2017 to comply with a court order to amply fund K-12 education.

All told, legislators approved more than $830 million in increased taxes over two years, though only a little more than half of that will go toward supporting the operating budget. The remaining $376 million will come from increasing taxes on big tech companies — including Amazon and Microsoft — and some service businesses, which will pay for higher education and workforce programs.

About $244 million of the new revenue going toward the operating budget comes from a graduated real-estate excise tax, which raises taxes on sales of real estate priced at $1.5 million or above. The increased tax rate applies only to the portion of the selling price above $1.5 million; meanwhile, people selling homes priced at $500,000 or under would get a tax cut. An even higher tax rate will apply to sales of homes priced above $3 million.

Another $133.2 million comes from increasing taxes on large banks.

Other new revenue comes from taxing vapor products, as well as narrowing the sales tax exemption for out-of-state shoppers, such as people from Oregon who come to shop in Washington. Travel agents and tour operators also will be taxed at a higher rate under the plan.

Republicans criticized the total spending level in the budget, as well as its reliance on increased taxes. The new 2019-21 operating budget will spend about 17 percent more than the state’s previous two-year budget.

“It relies on over $2 billion in new taxes that are simply unnecessary,” said state Rep. Drew Stokesbary, the House Republican budget leader, referencing how much the taxes would raise over four years.

State Rep. Jacquelin Maycumber of Republic, the House Republican floor leader, also criticized how the budget came together at the last minute, leading to lawmakers taking several votes on big tax bills in the middle of the night or early in the morning.

"This budget was developed in the dark of the night, on the 104th day, without transparency,” said Maycumber, noting how the budget was released on the second-to-last day of the session.

Democratic leaders, meanwhile, praised the spending plan as one that will invest in the future of Washington.

For one thing, the budget adds about $155 million in the next two years for special education, which lawmakers said they failed to fund adequately in in the public-schools plan they approved two years ago.

The budget also pays for the recommendations of a task force focused on preventing the extinction of orca whales, said state Sen. Christine Rolfes, the lead Senate budget writer.

"I am really thankful that we've gotten to a place where we can go home with a budget that represents the values of the entire state," said Rolfes, D-Bainbridge Island.

A plan to increase taxes on certain insurance premiums — advocated by Public Lands Commissioner Hilary Franz — isn’t included in the final budget. The tax would have raised about $62.5 million per year for wildfire prevention, firefighting and forest health projects. However, the budget spends $46 million on those items, a substantial investment compared with some previous years.

An earlier proposal to eliminate the sales tax on feminine hygiene products, such as tampons and menstrual cups, also didn’t make it into the final budget deal. Neither did a plan to get rid of the sales tax on diapers.

Inslee, a second-term governor who recently launched a campaign for president, told reporters at about midday Sunday that he was “ecstatic” with what the Legislature had accomplished, even before lawmakers had finished their work.

Besides coming to a budget deal that Inslee called “a solid plan,” lawmakers also passed Inslee’s proposals to move to 100 percent clean electricity by 2045, as well as to create what he is calling a “public option” for health insurance.

“This is a fantastic step forward for the state, both in education and the environment and a host of those issues that touch our health,” Inslee said about the agreed-upon budget. “… I’m very, very happy about it."

Later, after lawmakers adjourned, he bragged some more.

"There is a time to be humble," Inslee told reporters, "And this is not one of them."