Carlos Cordeiro, the embattled president of the U.S. Soccer Federation, announced his resignation Thursday night — an abrupt decision amid mounting criticism of him and the governing body for missteps in its legal battle with the women’s national team.

Vice President Cindy Parlow Cone, a former U.S. star, will step into the role, effective immediately. She becomes the organization’s first female president.

“It has become clear to me that what is best right now is a new direction,” Cordeiro said in an open letter. “The arguments and language contained in this week’s legal filing caused great offense and pain, especially to our extraordinary Women’s National Team players who deserve better. It was unacceptable and inexcusable.”

In those filings, the USSF said female players have less physical ability and responsibility than players on the men’s national team.

It caused a furor among observers who felt it belittled the four-time World Cup champions, and that in turn prompted high-profile sponsors to issue statements scolding the USSF.

On Wednesday, Cordeiro apologized. But criticism of the Chicago-based federation inside and outside the soccer community continued to grow.

Even Cone expressed her disappointment, writing on Twitter, “I am hurt and saddened by the brief USSF filed. This issue means so much to me, but more broadly to all men & women and, more importantly, to little girls & boys who are our future. I disavow the troubling statements and will continue to work to forge a better path forward.”

In his resignation letter, Cordeiro wrote, “I did not have the opportunity to fully review the filing in its entirety before it was submitted, and I take responsibility for not doing so."

Cordeiro was elected in February 2018, succeeding Sunil Gulati, who did not seek reelection after the failure of the men’s national team to qualify for the 2018 World Cup. Cordeiro was Gulati’s vice president.

Molly Levinson, spokeswoman for the female players suing the federation on gender discrimination grounds, said: “While it is gratifying that there has been such a deafening outcry against USSF’s blatant misogyny, the sexist culture and policies overseen by Carlos Cordeiro have been approved for years by the board of directors of USSF. This institution must change and support and pay women players equally.”

The case, in which the players are seeking almost $67 million in damages, is scheduled to go to trial May 5 in Los Angeles. Each side has asked the judge to rule in its favor before the case goes to trial.

Even before the filing became public this week, Cordeiro created a stir Saturday when, on the eve of the team’s match against Spain in Harrison, N.J, he accused the players of, among other things, “repeatedly declining our invitation” to negotiate a settlement.

The players denied that and expressed anger about the timing of the letter to federation members.

Before their subsequent match Wednesday against Japan in Frisco, Tex., the players wore their warmup jerseys inside out, hiding the USSF logo.

Former star players, such as Abby Wambach and Heather O’Reilly, called for Cordeiro’s resignation.

The federation’s problems run deeper than the women’s lawsuit.

There are several other legal challenges, including an antitrust case.

The chief executive position remains unoccupied following Dan Flynn’s retirement last year.

Many head coaching jobs in the youth ranks were filled only recently.

Many observers criticized the hiring of men’s national team coach Gregg Berhalter, whose brother Jay was, at the time, a USSF business executive.

Cordeiro, who as president was not paid by the federation, never seemed comfortable as the face of the organization. He declined media training and, in addressing the crowd at the World Cup celebration in New York last summer, mispronounced superstar Megan Rapinoe’s last name.

In his resignation letter, Cordeiro said, “As U.S. Soccer moves forward with its defense against the lawsuit by the team, I hope that our remarkable women’s players are always treated with the dignity, respect and admiration that they truly deserve.”