A city attorney is a position in city and municipal government in the United States. The city attorney is the attorney representing the municipality. Unlike a district attorney or public defender, who usually handles criminal cases, a city attorney generally handles civil cases, advising the city on legal matters and representing it in court. City attorneys may advise city officials on a wide range of city business, ranging from nuisances to tax law to municipal annexations. A city attorney also advises the city's legislative body (such as a city council) on the legality of proposed actions and assists in the drafting of city ordinances and resolutions. In some jurisdictions, city attorneys also function as prosecutors, pursuing low-level criminal cases against persons charged with violating city ordinances, such as those relating to public drunkenness, traffic violations, zoning and building codes, and municipal health regulations. In California, city attorneys have the power to seek gang injunctions in a civil proceeding in California state court. The client of the city attorney is the city, and the city attorney is typically responsible to both the mayor and the city council. When the mayor and the city council disagree, or when city council members disagree among themselves, this can cause complexities, such as the application and waiver of the attorney–client privilege. In some areas, the position of city attorney is a part-time position based on a retainer agreement, and city attorneys engage in the outside private practice of law. In some cities, the city attorney is elected, while in other cities, the city attorney is appointed. For example, in California, most large cities (including San Francisco, Los Angeles, and San Diego) have elected city attorneys, while most of smaller cities appoint their city attorneys. In some cities, the city attorney position is very powerful. For example, the elected position of San Francisco City Attorney is important due to the large array of duties associated with the office. Unlike all other California counties, San Francisco is a consolidated city-county, meaning that the San Francisco City Attorney handles legal duties in areas that would in other counties be the responsibility of the county counsel (such as county health and social services functions) as well as the duties of all California city attorneys (police and fire). The San Francisco city attorney is also unusually powerful because of the broad scope of properties and activities operated by the city