The Russian invasion of Ukraine in February 2022 led to Europe’s largest displacement of people since World War II, with significant substantial numbers of Ukrainian refugees seeking shelter in neighbouring countries. International research attests to the crucial roles public libraries can play in the reception and integration of refugees. However, diverse professional and geographical contexts and sociopolitical landscapes in which libraries work to support refugee reception and integration processes, necessitate ongoing and renewed focus on the topic. Therefore, this study examines how public libraries in Hungary and Poland responded to the influx of Ukrainian refugees, investigating their roles, programmes and partnerships. Using mixed methods, the study analyses previously unexamined 2018 questionnaire results and conducts 12 subsequent interviews with library staff. Findings reveal that libraries addressed a spectrum of user needs falling into three broad phases. Initially, they focussed on primary needs during the first phase, transitioning to settlement-related needs in the second phase. Variances between Poland and Hungary emerged during this phase, with Hungary primarily serving transient refugees and those with Hungarian backgrounds, while Poland saw a higher number of refugees of Ukrainian background settling. In the final phase, libraries emphasized literacy, integration and cultural support, aligning with reading and collection-oriented services. Service provision was characterized by nontraditional services in the first phase, non-collection-oriented services in the second phase and collection-oriented services in the third phase, with information provision central to all three phases. The study underscores public libraries’ role in addressing community needs, rooted in their core values of inclusivity and community engagement. However, their effectiveness hinges on inclusion in community-level efforts, awareness among new groups and securing economic and political support. Further research is warranted to explore library services to refugees globally amid increasing global migration and to understand the experiences of refugees using library services.