NPR and the SAG-AFTRA union, which represents roughly half of NPR’s workers, reached a contract agreement early Sunday.

Management and union members agreed to a tentative three-year contract that union members will have the opportunity to ratify in coming weeks, NPR spokesperson Isabel Lara said in a statement. The union will recommend the contract to its members, according to Lara.

SAG-AFTRA said on its website that the contract “provides for salary increases and effectively repelled efforts to erode union protections and institute a two-tiered salary system.” It was reached at 12:08 a.m. Eastern time Sunday.

Union members had voted Friday to send member and NPR newscaster Jack Speer to a SAG-AFTRA board meeting Saturday to seek approval for a strike authorization vote. That was the closest employees have ever come to striking, according to longtime correspondent Howard Berkes.

@sagaftra has 160k members. Can't let #NPR gut our contract. Asking Nat Board for approval to hold strike vote if needed.#WeMakeNPR #union — Jack Speer (@jackspeer1) July 15, 2017

In another first, a federal mediator was involved in negotiations.

Berkes and other union members welcomed the news of an agreement on Twitter:

Grateful too for the support from colleagues at @NPR stations. Remember, to support @sagaftra journalists support local NPR stations — Howard Berkes (@hberkes) July 16, 2017

Our amazing bargaining team couldn't have done this without the amazing ❤from everyone who said #ISupportNPR & nearly 14K petition ???? https://t.co/KAk73Veoj7 — Jessica Taylor (@JessicaTaylor) July 16, 2017

Happy tears were shed! Now I can focus on my vacation. #WeMakeNPR #ISupportNPR https://t.co/Obgs5Oacz6 — Lori Todd ???? (@loritodd) July 16, 2017

NPR and SAG-AFTRA agreed to extend a two-week temporary contract through Saturday to continue negotiating after it was set to expire Friday at midnight. The previous contract, signed in 2015, expired June 30.

Becky Sullivan, a member of the employees’ negotiating team and an associate producer for All Things Considered, previously told Current that NPR management “came out firing on all cylinders, basically trying to get a complete reset” of the contract. The union was resisting management requests to lower minimum starting salaries and to add language to the contract that would allow nonunion workers to do the work of union members.

SAG-AFTRA represents about 435 employees at NPR. It covers most newsroom jobs, including producers, on-air talent, digital positions, operations and librarians.