Objectives The study evaluated the compliance of community pharmacies with legal requirements as laid down by the drug regulatory framework in Pakistan. Methods An exploratory cross sectional survey was conducted with a total of 371 randomly selected community pharmacies in three cities in Pakistan, namely Islamabad (n = 118), Peshawar (n = 120) and Lahore (n = 133). A questionnaire was developed and finalized by focus-group discussions and pilot testing. The questionnaire included background information and a legal requirement scale consisting of six subscales: licensing requirements, premises requirements, storage requirements, documentation requirements, narcotics section requirements and prescription checking. The data were coded, entered and analysed using SPSS software (version 16). Kruskal-Wallis, Mann-Whitney and chi square tests were used for analysis. Key findings The pharmacies were operating with one of the three licence types operating in Pakistan: type A (n = 96, 25.9%), type B (n = 186, 50.1%) and type C (n = 89, 24.0%). A narcotics licence was issued to 133 (35.8%) pharmacies; licences of 66 (17.8%) pharmacies were expired while the validity of 87 (23.0%) licences could not be determined. Only 113 (30.5%) pharmacies were totally clean. Eighty percent of the pharmacies had a refrigerator for storage of medicines, but only 284 (76%) of the refrigerators were in working condition. Complete medicine purchase records with warranties were available at 210 (56.6%) pharmacies. Conclusions None of the pharmacies completely complied with the legal requirements in terms of licensing, premises, storage, documentation, narcotics section, drug labelling and prescription checking. This speaks of poor regulation and control by health authorities on the sale and dispensing of medicines in Pakistan. This study will serve as a baseline for policy makers, managers, researchers and other stakeholders in developing designs for future interventions as well as for methods of accountability and control.