This paper presents PRIVACYGRID - a framework for supporting anonymous location-based queries in mobile information delivery systems. The PRIVACYGRID framework offers three unique capabilities. First, it provides a location privacy protection preference profile model, called location P3P, which allows mobile users to explicitly define their preferred location privacy requirements in terms of both location hiding measures (e.g., location k-anonymity and location l-diversity) and location service quality measures (e.g., maximum spatial resolution and maximum temporal resolution). Second, it provides fast and effective location cloaking algorithms for location k-anonymity and location l-diversity in a mobile environment. We develop dynamic bottom-up and top-down grid cloaking algorithms with the goal of achieving high anonymization success rate and efficiency in terms of both time complexity and maintenance cost. A hybrid approach that carefully combines the strengths of both bottom-up and top-down cloaking approaches to further reduce the average anonymization time is also developed. Last but not the least, PRIVACYGRID incorporates temporal cloaking into the location cloaking process to further increase the success rate of location anonymization. We also discuss PRIVACYGRID mechanisms for supporting anonymous location queries. Experimental evaluation shows that the PRIVACYGRID approach can provide close to optimal location k-anonymity as defined by per user location P3P without introducing significant performance penalties.