Two Bay Area counties are preparing new rules on locally-grown produce in an attempt to contain the spread of a “disastrous” pest that will lead to the destruction of some entire crops, agricultural officials said.

The detection of oriental fruit flies has prompted officials to declare a quarantine of locally-grown fruits and vegetables in portions of Santa Clara and Contra Costa counties through mid-2024.

The oriental fruit flies, an invasive pest native to Asia, are known to burrow themselves into hundreds of types of fruits, rendering them inedible, according to a news release from the county. Among the fruits most susceptible to the pest are key California crops like avocados, apples, citrus fruits, tomatoes and peppers.

“It would be disastrous for the oriental fruit fly to get established in Santa Clara County and California,” county Agricultural Commissioner Joe Deviney said in the statement. “We all need to be vigilant in protecting our agricultural and natural resources. Please do not bring or ship any fruits, vegetables or plants into California without ensuring they are permitted by law.”

In efforts to prevent the spread of the flies, the quarantine covers a 112-square-mile area that includes the entirety of Santa Clara and portions of Cupertino, Milpitas, San Jose and Sunnyvale.

In Contra Costa County, the quarantine is a 99-square mile area, prompted by the discovery last month of seven male oriental fruit flies. Included are most of Brentwood and portions of Oakley, Discovery Bay and Antioch.

Matt Slattengren, the county’s agricultural commissioner and director of weights and measures, said the infestation by this kind of fruit fly is the first he’s experienced in his 23 years with the county. He believes it may be unprecedented.

The flies can infest most fruits and vegetables, he said, and one female can produce 1,500 eggs in one lifetime, which allows the population to grow and spread rapidly.

“This is pretty close to our agricultural core, where we do most of the growing,” Slattengren said. “Some people will lose their entire crops over this.”

Under the quarantine, which is expected to last until June 1, 2024, residents within the limits are required to keep homegrown fruit at their residence. The crops can still be eaten or processed, but if they’re disposed of, the crops must be double-bagged and sealed.

Some businesses, including farms, plant nurseries, farmers markets and fruit vendors, will be affected by the quarantine. County officials will work with businesses to establish compliance agreements to ensure that infested materials do not leave quarantine areas.

“They’ve reached out to us and they’ve told us we’re going to be encompassed in (several markets),” said Jerry Lami, the executive director of the West Coast Farmers Market Association, which operates 11 farmers markets across the Bay Area.

Lami said many fruits and vegetables will need to be covered with cloth or plastic wrap, which would prevent insects from landing on them and laying eggs. Vendors will be required to bring fewer crops to markets, as leftovers won’t be allowed back on farm property after being exposed at market.

He added that officials in the South Bay were still trying to determine which fruits and vegetables the flies might be targeting.

Contra Costa County announced its own infestation of oriental fruit flies at the end of August, after officials said they had detected seven male flies near Brentwood and Oakley. On Wednesday, the state farm and agriculture department announced its quarantine, based on the results of surveying to determine the spread of the pest.

A quarantine of a similar scale was imposed in 2021 when oriental fruit flies were discovered in the Santa Clara Valley. The quarantine mostly focused on the southern part of San Jose.

During the quarantine, the California Department of Food and Agriculture will place bait on trees, poles and other surfaces near the area the flies were found. The bait contains an organic pesticide, spinosad, which kills the flies. According to the county, this method is safe for people and pets.

The announcement comes less than two weeks after Santa Clara County said it would spray for oriental fruit flies after finding only two of the insects in the region.

Two South Bay women were recently charged with the illegal importation of fruit after they allegedly organized the transportation of the tropical fruit langsat from Vietnam in 2022. Portions of the fruit were found to have the larvae of an invasive species of fruit fly native to South Asia.

Officials on Wednesday did not offer any link between the Santa Clara County oriental fruit fly infestation and the illegal fruit-import charges.