The emerald ash borer, an invasive beetle that has killed tens of millions of ash trees across a wide swath of the country, has been found in Berkshire County, its first appearance in Massachusetts.

The tiny but destructive insect, which has caused billions in economic damage since it was first discovered in North America in 2002, was found Aug. 31 in a trap in Dalton, a small town near Pittsfield. Tests confirmed last week that Massachusetts has become the 18th state to encounter the feared pest.

“Massachusetts has an uninvited guest,” Edward M. Lambert Jr., commissioner of the state Department of ­Conservation and Recreation, said at a press conference Wednesday.

State and federal officials said that they were working to determine the scope of the infestation and that the ­potential for damage is immense.

Native to Asia, the beetles kill ash trees within a few years by boring under the bark. Over the past decade, the ­beetle has become one of the nation’s most destructive forest pests. When it becomes established, it effectively ­destroys the ash tree population, specialists said.

There are some 45 million ash trees in Massachusetts, about 3 percent of the state’s trees. But nearly half of the state’s ash trees are in Berkshire County.

State and federal officials urged the public not to move firewood from where it is cut, the primary means of spreading infestation, and said they may restrict the transport of wood products from the Dalton area in an effort to limit the damage.

Lambert said he was mindful of the cost and inconvenience the restrictions would have on the timber industry, but said the threat may call for strong measures.

“Prevention is the key to limiting the infestation,” Lambert said. “Certainly, one sighting is enough to require action.”

Officials have not found any infested trees, but are searching the forest where the beetle was found. State and federal officials will then determine the necessary restrictions.

Since it was first discovered in Michigan a decade ago, the beetle has steadily moved eastward, and officials in Massachusetts had braced for its probable arrival. In April, the pest was found east of the ­Hudson River in New York for the first time, and in July it was found in several towns in ­Connecticut.

“We’ve been on the lookout,” said Bob Childs, an entomologist at the University of Massachusetts Amherst.

Childs said extensive trapping began last year and did not detect the beetle, suggesting that it has not been in the area long. If true, early detection will help limit its spread, he said.

The emerald-green beetle can often cause significant damage without notice, Childs said, because it primarily lives in the tops of trees.

“So no one notices until the top third of the tree is dead,” he said. “At that point it’s too late. It’s an extremely frustrating pest.”

The arrival of the pest recalls the 2008 infestation of Asian longhorned beetles in Worcester, which forced the removal of some 27,000 trees. State and federal officials hesitated to compare the two situations ­until the scope of the new threat is better understood, but said the concentration of ash trees, and their value to the lumber industry, increased the risks.

Ash wood is used for baseball bats, furniture, cabinetry, packing materials, and paper. In Massachusetts, the firewood industry alone is $100 million.

“You can understand why we take this seriously,” Lambert said.

Mike Groll/Associated Press/File

A forester pointed out the telltale signs of emerald ash borer beetle larvae on a tree in New York.

Lambert said the state’s ­experience in Worcester will “serve us well in this new battle,” while other specialists pointed to the early detection of longhorned beetles in Boston. Since the 2010
discovery of six infested trees
at the Faulkner Hospital in Jamaica Plain, no other damage has been seen.

“This is how it needs to work,” Childs said. In Worcester, the first area in New England where the longhorned beetles were found, the infestation of maple trees was well along by the time it was discovered.

So small that seven fit on the head of a penny, emerald ash borers do not typically travel far, but reproduce quickly and will disperse to find new ash trees. Adults feed on tree leaves, but females lay eggs on or under the bark. Larvae burrow ­into the tree and eventually eat their way out of the tree, leaving D-shaped exit holes.

“It has a remarkable capacity for population growth,” said Nate Siegert, an entomologist with the US Forest Service.