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
The incident involving three vehicles happened on the eastbound between Cardiff Gate and Tredegar Park.
Ahead of a meeting of ministers from Britain and Ireland, the Welsh and Scottish First Ministers join forces to urge a Brexit rethink
Negative perceptions of the south Wales valleys are affecting the ambitions of young people living within its towns, says a Labour MP.