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
Speaking at a Brexit Party rally, Nigel Farage said the party will be targeting seats in the traditional Labour heartland.
It will be another sunny day for much of Wales. However, some cloud will push into southwestern parts during the afternoon.
The Met Office have warned flooding could happen in some areas due to heavy rain on Sunday.