North Las Vegas has reached agreements with the last of its employee unions today that will help the city balance its budget for the upcoming fiscal year and avoid a takeover by the state.

The announcement came from Mayor John Lee shortly after 5 p.m. Thursday after two days of intense negotiations.The city for months has pinned its hopes of solving its $18 million budget deficit on extracting concessions from its unions. Without concessions, the city could have been forced to lay off staff and cut services, while risking a takeover of its finances by the state and eventually disincorporation.

The city’s $18 million budget deficits will be solved through several means: $10.4 million will come from union concessions, another $4.8 million will be saved through a hiring freeze and $2.6 million will be trimmed from department budgets.

City finance staff will work over the weekend to update a tentative budget that was presented to the City Council in a special meeting Thursday night to reflect the new union deals.

The union agreements announced Thursday were a major step forward for North Las Vegas as it attempts to dig its way out of a financial hole created by the recession and several costly expenditures, including the $130 million city hall building and a $300 million wastewater treatment plant, which both opened in 2011.

The city has solved its short-term budget crisis by closing its deficit, but it still faces an uncertain future with escalating debt payments and a need to wean itself off utility fund transfers that have propped up the general fund for several years.

Lee was confident Thursday that after solving its short-term issues, the city will have similar success tackling the longer term budget problems.

“North Las Vegas is no longer on the brink of despair and destruction but on the brink of a bright future,” Lee said.

Negotiations between the city and its unions have been progressing for months, but a new sense of urgency set in this week as the April 15 deadline to file a balanced budget to the state grew closer.

Officials spent most of Wednesday and Thursday at the bargaining table. The firefighters and Teamsters unions announced deals with the city Wednesday after a day of negotiations at Gov. Brian Sandoval’s Las Vegas office. The North Las Vegas Police Officers Association and North Las Vegas Police Supervisors Association both agreed to deals Thursday afternoon.

All four deals must still be ratified by the City Council and members of the different unions.