The deal was reached 15 minutes before Wednesday night's midnight deadline, by which time the players would have officially denounced the club to the Spanish Football League (LFP) to activate a punishment of automatic relegation.
The AFE, the players' union, will cover the outstanding wages, which will be reimbursed by the third-party guarantor, who has not yet been named.
The Galician club, who won the Primera Division title in 2000, were relegated from Spain's top flight on the final day of last season, for the second time in three years.
Last January the club entered administration, declaring it had a debt of 93million euros.
"Today is a good day, one on which we can look to the future with calm," club president Augusto Cesar Lendoiro was quoted by AS as telling reporters after leaving a meeting between the club, its administrators, the AFE and the LFP.
"I never thought the club was in danger of not staying in the Segunda Division. The negotiations have been tough, but in the end we reached an agreement."
However, he warned the club was not out of the woods yet, saying: "The issue won't be resolved immediately, we still have no viable plan."
The club's coach Fernando Vazquez added: "We are extraordinarily happy. This is a shot of adrenaline in the arm, we will survive."
Two other Spanish clubs, however, were not so lucky.
Last night Guadalajara saw their appeal against their automatic relegation from Segunda A to Segunda B rejected by a court, while Xerez, who were in the top flight as recently as 2010, were condemned to the fourth tier after being unable to pay their players.
The Andalusian club were relegated to Segunda Division B last season.