Most of the Spain team have agreed to end their boycott, says secretary of state for sports Victor Francos.
The agreement was reached at 05:00 local time on Wednesday after more than seven hours of meetings.
Francos said the Spanish football federation (RFEF) had committed to “immediate and profound changes”.
Two of the 23 players named in the squad for this month’s Nations League games – Mapi Leon and Patri Guijarro – have left the squad.
The rest of the players began the boycott after then RFEF president Luis Rubiales kissed forward Jenni Hermoso following Spain’s triumph over England in the Women’s World Cup final on 20 August.
The kiss, which Hermoso said was not consensual, led to Rubiales’ resignation, while Spain manager Jorge Vilda was sacked.
Spain are due to play Sweden on Friday and Switzerland on Tuesday.
Francos, the head of the Spanish government’s national sports agency (CSD), said: “It is good news to be able to say that the team will play the next two games with guarantees.”
He said a decision was reached following “friendly” talks in Valencia involving the players, RFEF officials, CSD and women’s players’ union Futpro.
“A joint commission will be created between RFEF, CSD and players to follow up on the agreements, which will be signed tomorrow,” Francos said.
“The players have expressed their concern about the need for profound changes in the RFEF, which has committed to making these changes immediately.”
Francos said Leon and Guijarro would not face sanctions and their decision was “absolutely respectable”. The players could have faced fines or a ban from the Spain side for not turning up for international duty.
Leon and Guijarro were among 15 players to boycott the national team before the World Cup in protest at the methods of then coach Vilda. They were not involved at this summer’s tournament in Australia and New Zealand.
“It’s a reality that the situation for me and for Patri is different to the rest of our team-mates,” Leon said.
“We already knew this was not the right way to return, and we are not in the right state.
“We are content because the truth is that changes are being made, and in this we are giving full support to our team-mates.”
Guijarro said: “They are working on the changes and of course we are with our team-mates, but it’s true that it’s a different situation.
“It’s quite difficult and quite hard. Mentally we are not right to be here.”
On Monday new head coach Montse Tome selected 15 players who were part of the World Cup squad in her squad for the Nations League games.
After it was announced, the players published a statement saying the boycott remained in place and that they had been “put in a position in which we never wanted to be in”.
They said they intended to explore the potential legal implications of being called up against their wishes.
Tome omitted Hermoso from the squad “to protect her”.
Hermoso said selecting players who are boycotting the team showed “nothing has changed” at RFEF.
The CSD said a commission would be established to monitor the agreed changes, which will focus on equality policies, advances in equal pay and improving the infrastructure of women’s sport.
Futpro president Amanda Gutierrez said: “The players see it as a rapprochement of positions. The vast majority have decided to stay for the sake of this agreement.
“It is the beginning of a long road ahead of us.”
The Spain players travelled to the training camp in Valencia on Tuesday.
Asked by reporters at Barcelona airport how she felt about the situation, midfielder and two-time Ballon d’Or winner Alexia Putellas said: “Well, bad.”
Rubiales has been banned from going within 200 metres of Hermoso after she filed a legal complaint.
Appearing in court for the first time on Friday, Rubiales denied sexually assaulting Hermoso.