SABILLASVILLE, Md.  When they retreated from the Battle of Gettysburg, Confederate troops passed by the area that is now Richard Masser’s orchards. If only the latest enemy  the brown marmorated stink bug  would follow suit.

Damage to fruit and vegetable crops from stink bugs in Middle Atlantic states has reached critical levels, according to a government report. That is in addition to the headaches the bugs are giving homeowners who cannot keep them out of their living rooms  especially the people who unwittingly step on them. When stink bugs are crushed or become irritated, they emit a pungent odor that is sometimes described as skunklike.

Suddenly, the bedbug has competition for pest of the year.

Farmers in Maryland, New Jersey, Pennsylvania and other states are battling a pest whose appetite has left dry boreholes in everything from apples and grapes to tomatoes and soybeans. Stink bugs have made their mark on 20 percent of the apple crop at Mr. Masser’s Scenic View Orchards here. Other farmers report far worse damage.

“They’re taking money out of your pocket, just like a thief,” said Mr. Masser, flicking stink bugs off his shirt and baseball cap as he overlooked his 325 acres, a few miles south of the Pennsylvania border. “We need to stop them.”