NEW YORK – The NFL and the referees’ union have reached a tentative contract agreement, ending an impasse that began in June when the league locked out the officials and used replacements instead.

The NFL said it planned to have regular refs work Thursday night’s Cleveland-Baltimore game.

With Commissioner Roger Goodell at the table, the sides concluded two days of talks at midnight Thursday with the announcement of a tentative eight-year deal, which must be ratified by the union’s 121 members.

NFL spokesman Greg Aiello tweeted “Pleased to report that an agreement has been reached with the NFL Referees Association. Details to follow.”

The replacements worked the first three weeks of games, triggering a wave of frustration that threatened to disrupt the rest of the season. After a missed call cost the Green Bay Packers a win on a chaotic final play at Seattle on Monday night, the two sides really got serious.

It was not certain who would work this week’s games, but ESPN reported regular refs will work Thursday night with Baltimore hosting Cleveland.