The deal was reached late Wednesday night and the two sides will finalize the paperwork later Thursday morning, a league source told ESPN NFL Insider Adam Schefter. Regular union referees will be on the field in Baltimore Thursday night when the Ravens face the Cleveland Browns.

“Our officials will be back on the field starting tomorrow night,” commissioner Roger Goodell said in a joint statement released by the NFL and NFLRA. “We appreciate the commitment of the NFLRA in working through the issues to reach this important agreement.”

The new collective bargaining agreement between the two sides is for eight years, according to ESPN. Members of the referees union are expected to vote to ratify the pact on Saturday.

Replacement referees worked the first three weeks of the regular season, and were under intense scrutiny from players, fans and coaches. The controversy reached its apex during Monday Night Football this week after a blown call on the final play of the fourth quarter cost the Green Bay Packers a win against the Seattle Seahawks.

The fury over the replacement refs made it all the way to the White House, with President Obama tweeting earlier this week, “NFL fans on both sides of the aisle hope the refs’ lockout is settled soon.”

The NFLRA was seeking improved salaries and retirement benefits in their negotiations with the NFL during the lockout.

According to the joint statement released by the NFL and NFLRA Wednesday night, “Retirement benefits will be provided for new hires, and for all officials beginning in 2017, through a defined contribution arrangement, which will have two elements: an annual league contribution made on behalf of each game official that will begin with an average of more than $18,000 per official and increase to more than $23,000 per official in 2019, and a partial match on any additional contribution that an official makes to his 401(k) account. “

“Apart from their benefit package, the game officials’ compensation will increase from an average of $149,000 a year in 2011 to $173,000 in 2013, rising to $205,000 by 2019,” the statement continued.

Another point agreed upon by the two sides was the NFL’s demand for a pool of 21 developmental officials who will eventually be considered for membership in the union of 121 regular referees once properly trained.