WORCESTER - Four neighborhoods will be sprayed Tuesday to control the mosquito population, after the state Department of Public Health informed local officials that West Nile virus had been detected in mosquitoes in the city.

Worcester's Division of Public Health and Department of Inspectional Services coordinated with the Central Massachusetts Mosquito Control Project to spray areas around Burncoat and Hampton streets, Westview Road and Willowbrook Lane between dusk and midnight, the city said in a statement. Maps showing all the streets to be sprayed are online at bit.ly/2nwYMOQ.

Residents are advised to close street-facing windows and keep pets inside between sunset and midnight. The pesticide is similar to ones used for flea and tick control. Residents should stay inside during the spraying and for 15 to 20 minutes afterward.

The city said accidental exposure is not likely to cause health problems in most people, and no precautions are needed the day after the application.

Residents with gardens are advised to wash vegetables before consuming them.

Any “outside air” controls on older window unit air conditioners should be turned off.

Residents can opt out of spraying in front of their property by visiting www.mass.gov/how-to/how-to-request-exclusion-from-wide-area-pesticides-application.

West Nile is most commonly transmitted to humans by the bite of a mosquito infected with the virus. While West Nile can infect people of all ages, those over age 50 are at higher risk for severe infection.

Another neighborhood was sprayed for the virus recently.