The council says the sale proceeds will go back into library services
Organisations involved in plans to sell some of Wales' oldest and rarest books say they have "agreed a way ahead".
Cardiff council proposals to sell up to 18,000 items eventually have provoked calls by one group to halt the sale "of some of Wales' greatest treasures".
After a "positive meeting" several organisations have now agreed to identify which should be kept in Wales.
The heritage minister said it would mean "important cultural and historical items are not lost to Wales".
The council had earlier removed 32 books from the auction it is planning, and has said all the money the sale generates will go back into the city's library service.
But the group which opposes it, Cardiff Heritage Friends, has claimed the council should be "exploiting" its assets rather than selling them, to "enhance Cardiff's prestige as a city of culture and learning".
The organisations which met to discuss the sale are Cardiff council, Cardiff University, the National Library of Wales and Glamorgan Record Office.
In a statement, they said they had "agreed that they would work together to identify which items from the collection should be recommended to be retained in Wales.
"Specialist expert support will be provided, including specialist advice from the National Library of Wales and Glamorgan Record Office.
"All parties recognised Cardiff council's desire to invest in an improved library."
Alun Ffred Jones, the Welsh Assembly Government heritage minister, said: "I'm pleased that the parties involved have been able to agree a way forward and I look forward to the establishment of a partnership which can provide advice to Cardiff council so that important cultural and historical items are not lost to Wales."
Nigel Howells, the council's executive member for sport, leisure and culture, said: "The key outcome we wanted was to find a way forward that allowed us to invest in the public library service through the auction of some items.
"It is doubly pleasing that we have agreed a way forward in partnership that allows for important items to be retained in Wales".
The organisations will meet again for more discussion in greater detail.