Soccer’s U.S. Women’s National Team alleged gender discrimination in a lawsuit against the U.S. Soccer Federation, a dramatic step just months from the kickoff of a Women’s World Cup in which the American squad is the defending champion and favored to repeat.

All 28 of the players in the current U.S. player pool sued the federation in U.S. District Court in Los Angeles on Friday, alleging female players earn less than their U.S. Men’s National Team peers despite having the same job responsibilities and having had more success on the field.

In one comparison looking at pay for a nearly four-year period through 2016, the suit says that if each team played and won 20 non-tournament games a year, a top-tier women’s player would earn 38% of what a high-level men’s player would make.

The suit creates a high-profile pay-equity showdown between members of one of the nation’s most successful teams and its employer. The U.S. Soccer Federation governs amateur and professional soccer in the U.S., including selecting, managing and setting pay for national teams.

Members of the women’s team say they have played and won more games, earned more championships and garnered bigger television audiences than their male counterparts and deserve equal compensation. The men’s team failed to qualify for the 2018 World Cup after an appearance in the Round of 16 four years earlier.

The suit, which seeks class-action status, seeks unspecified damages and other relief. Players said they aren’t considering a boycott of the World Cup.

“Each of us is extremely proud to wear the United States jersey, and we also take seriously the responsibility that comes with that,” veteran U.S. forward Alex Morgan said. “We believe that fighting for gender equality in sports is a part of that responsibility.”

How They Compare The U.S. women's soccer team has had more success than the men’s team in friendlies and major competitions. Regular-season win percentage Women's team Men's team 100 % 75 50 25 0 ’18 ’16 2014 ’17 ’15 Major competitions Runner-up 3rd place Winner Didn’t place or medal Didn’t qualify Men World Cup* Women 2018/19 2014/15 2010/11 2006/07 Women Men Olympics † 2016 2012 2008 2004 Regular-season win percentage Women's team Men's team 100 % 75 50 25 0 ’18 ’16 2014 ’17 ’15 Major competitions Runner-up 3rd place Winner Didn’t place or medal Didn’t qualify Men World Cup* Women 2018/19 2014/15 2010/11 2006/07 Women Men Olympics † 2016 2012 2008 2004 Regular-season win percentage Women's team Men's team 100 % 75 50 25 0 ’18 ’16 2014 ’17 ’15 Major competitions Runner-up 3rd place Winner Didn’t place or medal Didn’t qualify Men World Cup* Women 2018/19 2014/15 2010/11 2006/07 Women Men Olympics † 2016 2012 2008 2004 Regular-season win percentage Women's team Men's team 100 % 75 50 25 0 ’18 ’16 2014 ’17 ’15 Major competitions Runner-up 3rd place Winner Didn’t place or medal Didn’t qualify Men World Cup* Women 2018/19 2014/15 2010/11 2006/07 Women Men Olympics † 2016 2012 2008 2004

U.S. Soccer didn’t respond to a request for comment. In a statement, the union representing players on the men’s team said it supports a proposal from the women to tie player compensation to how much of the soccer federation’s revenue is attributed to either side.

High-achieving women in other sports also have worked toward pay parity with male counterparts. Women’s tennis players at Wimbledon in 2007 gained prize money equal to what men earn. Members of the U.S. women’s hockey team, which has won a medal in all six Olympics that featured the sport, won increased support from USA Hockey days before their threatened boycott of the 2017 World Championships over pay.

The soccer lawsuit makes allegations similar to a March 2016 complaint by five U.S. women’s team players to the Equal Employment Opportunity Commission.The federation said in response to that complaint that pay differences were due to factors other than gender, such as varying compensation from club teams and a World Cup bonus structure set by FIFA, soccer’s world governing body.

In response to the women’s players’ demand for equal pay in 2016, a federation representative said that “market realities are such that the women do not deserve to be paid equally to the men,” according to the lawsuit.

U.S. Soccer Federation President Carlos Cordeiro said, in a recent interview, that the situation with the women’s team had improved since the collective-bargaining agreement.

“I’m not saying it’s perfect and equal, but it doesn’t have that same biting, very negative slant to it,” Mr. Cordeiro said. “Because the little things we can do, we did immediately. Our women travel the same class of air, the same class of hotels. There’s charters available to them when they need them.”

The U.S. women made gains in a 2017 collective-bargaining agreement with the federation but said that deal didn’t go far enough. At that time, the team opted to compromise rather than disrupt its season.

The lawsuit alleges the federation discriminates by paying the women’s team less than members of the men’s team and by “denying them at least equal playing, training, and travel conditions; equal promotion of their games; equal support and development for their games; and other terms and conditions of employment equal to the MNT.”

Player salaries aren’t all publicly listed, so comparisons between men and women players are difficult. But in the federation’s tax filings for the year ended March 2018, women’s players Becky Sauerbrunn and Kelley O’Hara are listed as among key employees and the highest-compensated people, each making about $257,000, including bonuses. There are no men’s player salaries listed in that filing, but total compensation for Tab Ramos, head coach of the under-20 men’s team, is listed as $345,297.

The head coach of the Women’s National Team, Jill Ellis, is listed as having made $318,533 that year. Ms. Ellis coached the team to the 2015 Women’s World Cup title.

According to the suit, the Men’s National Team took in performance bonuses totaling nearly $5.4 million for the 2014 World Cup. The suit says that for the 2015 Women’s World Cup, the federation provided the winning U.S. team with more than $1.7 million, according to the lawsuit. The men’s and women’s tournaments are each held every four years.

Unlike in the men’s game, where the U.S. is a perennial underdog against nations with richer soccer histories, the U.S. women’s team has won three World Cups and four Olympic gold medals since both those competitions began in the 1990s. The U.S. victory in the 2015 World Cup final against Japan was the most-watched soccer game of all time in the U.S., with more than 25 million viewers.

Alex Morgan playing during a SheBelieves Cup match between the U.S. and Brazil earlier this week in Tampa, Fla. Photo: Andrew Bershaw/Zuma Press

The U.S. men’s team hasn’t advanced past the World Cup quarterfinals since finishing third in the first World Cup in 1930.

The Women’s World Cup begins June 7 in France. The U.S. women have struggled by their standards recently, but they went undefeated in 2018 and hold the world No. 1 ranking.

The 2017 women’s collective-bargaining agreement, which lasts through 2021, included increased pay for participation in national-team duties, the opportunity to win more bonus money, improvements in travel, and federation investments in the National Women’s Soccer League.

Even though FIFA is doubling the prize money for this summer’s Women’s World Cup, to $30 million from $15 million in 2015, the gap between the women’s and men’s World Cup prize money has widened.

The men’s teams at last summer’s World Cup in Russia shared $400 million in prize money. In Qatar in 2022, that prize pool will increase to $440 million.

Corrections & Amplifications

The 2018 World Cup was held in Russia. An earlier version of this article incorrectly stated it was held in France. (March 8, 2019)

Write to Rachel Bachman at rachel.bachman@wsj.com