Campaigners in Rhondda Cynon Taf say the local council has performed a u-turn on its decision to close Rhydyfelin Library.
They say the council has asked them to withdraw their judicial review case, and will re-open the library.
Local residents launched their legal challenge after saying they were not consulted on the closure, which went ahead at the end of May, even after a group chained themselves to the shelves.
The closure was one of 14 made by Rhondda Cynon Taf Council as it tries to make savings of £70m over the next four years.
Campaigner Sian Perkins said today: "We are truly elated. This victory is down to the power of the people. The whole community was committed to fighting to save this very necessary establishment and we weren’t prepared to back down."
“Rhydyfelin library is a vital component of our community used by everyone from pre-school children to pensioners."
More top news
Swansea West MP Geraint Davies will try to change the law so that the UK cannot leave the European Union without a second referendum
Widespread frost and ice to start with light snow across some southeastern areas.
More than 800 people were asked how they felt about politics in Wales