Cancer pain presents in approximately 66% of patients in advanced stages. Although several guidelines and pharmacological options are available for cancer pain management (CPM), assessment and treatment of cancer pain remain inadequate globally, particularly in developing countries. Lack of knowledge and negative attitudes towards CPM among healthcare professionals (HCPs) are important barriers to CPM. This survey aimed to evaluate nurses’ and physicians’ knowledge, attitudes, and potential barriers regarding CPM in Libya. This cross-sectional survey involved a convenience sample of 152 oncology nurses and physicians working in six oncology settings in Libya. The response rate was 76%. The Barriers Questionnaire II (BQ-II) was used for data collection (higher scores signify greater attitudinal barriers and poorer knowledge). Data analysis was carried out using Statistical Package for Social Sciences (SPSS), version 26 software. An independentt-test (unadjusted estimate) indicated that Libyan nurses showed higher mean barrier scores (mean = 3.8,SD= 0.7) to CPM than physicians (mean = 2.9,SD= 0.8),p< 0.001. The six most common differences in attitudinal barriers between nurses and physicians were “opioid side effects,” “poor tolerance,” “strong patient endures pain,” “distract the physician,” “drug addiction,” and “opioids impair immune function,”p< 0.001. Multiple regression results (adjusted estimate) indicated that nurses had more barrier scores to CPM than physicians (B =  − 0.530,p< 0.05), and participants with higher educational levels were associated with lower barrier scores to CPM (B =  − 0.641,p< 0.05). Our results suggest that Libyan oncology HCPs hold perceived barriers, lack of knowledge, and negative attitudes towards CPM. Professional education and training in CPM, addressing phobia and myths on opioid usage, and the benefits and complications of using opioids are likely to result in reduced barriers to CPM in Libya.Supplementary InformationThe online version contains supplementary material available at 10.1007/s13187-022-02185-5.