The lockout of Major League Soccer's referees has ended following an agreement on a five-year labor contract.

The Professional Referee Organization, which manages game officials for the U.S. Soccer Federation and MLS, and the Professional Soccer Referee Association announced the agreement Thursday. Replacements had been used for the first two weekends of MLS games.

The PSRA was certified by the National Labor Relations Board last May to represent referees, assistant referees and fourth officials working MLS games, and the sides had bargained since July. The lockout began March 7, a day ahead of MLS openers.

The Federal Mediation and Conciliation Service entered talks, and a tentative agreement was reached Tuesday night that was ratified by the union membership and approved by PRO's executive board.

"First contracts sometimes pose difficult challenges as the parties seek to define the parameters of a new formal relationship," FMCS acting director Scot L. Beckenbaugh said in a statement.

More From ESPN Western Colorado