Just three days before hosting the world championships, USA Hockey and the women’s national team reached an agreement to end a wage dispute and avoid a boycott on home ice.

The four-year deal finalized Tuesday night pays players beyond the six-month Olympic period, up to $129,000 if they win Olympic gold and improves development of the sport.

“We didn’t want to settle for something that wasn’t going to push women’s hockey as far as we thought it was able to go,” U.S. captain Meghan Duggan said by phone. “Really excited about what this brings for the future of women’s hockey.”

The deal means players will be on the ice Friday in Plymouth, Michigan, to begin their title defence against archrival Canada. The team is scheduled to practice Wednesday once everyone arrives for hurried preparations in advance of a tournament that now will be a celebration of USA Hockey instead of a stage for criticism after the dispute drew the attention of several sports unions and U.S. senators.

USA Hockey executive director Dave Ogrean said laying a foundation for the future of the women’s game was the crux of the agreement.

“It was critical to go through this process and to get this done, and I’m pretty sure that the women are very, very satisfied with where we ended up and it puts us in a great place to all move forward in a great way,” Ogrean said by phone Tuesday night.

Coming off making just $1,000 a month for six months around the Olympics, this contract pays players roughly $3,000 a month. Annual compensation can surpass $70,000 when combined with contributions from the United States Olympic Committee.

Players receive Olympic medal bonuses of $20,000 for gold and $15,000 for silver from USA Hockey and $37,500 for gold, $22,500 for silver and $15,000 for bronze from the USOC. It could be a banner year for the women’s national team if successful at the 2018 Olympics in Pyeongchang, South Korea.

The agreement includes insurance protection and the same business class travel that the men get for the world championships.

“There was compromises on both sides, but the contract in its entirety, it’s going to change the lives of the current players that are on the team right now (and also) the next generation,” star forward Jocelyne Lamoureux-Davidson said by phone. “It’s going to be a turning point for women’s hockey in the U.S. (and) I feel like a turning point for women’s hockey in the world.”

USA Hockey president Jim Smith said people will look back on this day “as one of the most positive in the history” of the organization.

After more than a year of negotiations over wages and equitable support, players announced March 15 that they’d boycott the International Ice Hockey Federation Women’s World Championship if significant progress wasn’t made toward an agreement. The sides met for 10-plus hours in person last week and continued conversations before finally agreeing to a deal.

Duggan said it was possible the original team wouldn’t be on the ice for the tournament.

“That was a reality from Day One,” Duggan said. “We put that on the line.”

Over the course of the public dispute, unions from the NHL, NFL, NBA and Major League Baseball and 16 U.S. senators voiced support for the players. NHL agent Allan Walsh tweeted that men’s players were considering boycotting their world championship in solidarity if a deal didn’t get done.

The senators’ letter noted the $6,000 that players earn around the Olympics and USA Hockey’s $3.5 million annual spending on the men’s national team development program.

The deal includes the formation of a women’s high performance advisory group with current and former players — like Hockey Canada has had for some time. The group’s goal is to advance girls’ and women’s hockey programing, marketing, promotion and fundraising to augment existing grassroots programs.

“That’s an instrumental part in the contract,” Lamoureux-Davidson said. “It’s going to be important to not just sign a deal and be done with it but to continue to grow the sport and to market our sport and market the players. It’s just going to create numbers at the grassroots level that I think players want to see and USA Hockey wants to see.”