The replacement referees arenfinally gone, after three weeks in the NFL.

The NFL and the NFL Referees Association announced that they agreed upon a deal at midnight on Thursday.

The two sides met until 2 a.m. ET on Wednesday, but couldn’t reach a compromise. After further deliberations, they decided to end the lockout.

A deal didn't look promising on Wednesday morning. An agreement wasn't made after the sides met for 17.5 hours.

The officials agreed to certain concessions, but team owners would not give in on some issues, specifically the refs’ pensions. League officals and the refs met later in the day and agreed on a compromise.

The number of additional full-time officials had been an issue, but it was eventually settled. The refs originally wanted 21 more officials to be added. Under the agreement, 21 hopefuls will enter the developmental program, work with crews during the week and be promoted on merit.

A lot of pressure has been put on commissioner Roger Goodell to broker a deal after the controversy between the Packers and Seahawks on Monday Night Football.

The replacement refs have been criticized so harshly during game broadcasts, that networks were asked to “take it easy” on the officials. FOX analyst and former player John Lynch told “The Dan Patrick Show” that the league lied, saying the regular officials were about to get back to work.

“They duped us,” said Lynch. Announcers have since ignored the NFL’s request, after it became clear that the two sides were not close on a deal.

Even if the two sides have come to an agreement , there's a chance the officials wouldn’t be ready to take the field for the start of Week 4. The Cleveland Browns and Baltimore Ravens kick off the week with a tilt on Thursday Night Football.