Thousands of residents lost electricity Wednesday morning as the state was hit with rain and strong wind gusts.

Central Maine Power reported more than 7,000 customers without power at 7 a.m., but the number dropped to around 4,600 by 8:30 a.m. and fewer than 1,500 by 1 p.m. By 4:30 p.m., only 73 customers were without power. Most of the outages were reported in Androscoggin and Cumberland counties. Outages were also reported in Brunswick, Freeport, Yarmouth and Hollis.

Harrison Middle School in Yarmouth was closed Wednesday because there was no power to the building. School officials said all other Yarmouth schools would open for the day, but notified parents that Yarmouth Elementary School was experiencing a partial power outage. Staff members gathered elementary students in classrooms and other spaces that had electrical or natural lighting until full power could be restored, according to a letter from Superintendent Andrew Dollofff sent to parents.

On Wednesday afternoon, Emera Maine reported nearly 3,000 outages, primarily because of wind in the Amherst and Ellsworth area, according to the company’s website. By 4:30 p.m., only 49 customers were still without power, the website showed.

Meteorologist Tom Hawley of the National Weather Service in Gray said wind gusts early Wednesday likely contributed to power outages. The strongest wind gust recorded Wednesday was 37 mph at 5:19 a.m. in Portland, but within two hours wind gusts were down to 22 mph, he said.

“It looks like tomorrow we’ll see more rain move in, giving us possibly heavy rain at times,” Hawley said.

Hawley said the rain was heavy enough to help with wildfires in Lincoln, New Hampshire, and in the Grafton Township, Maine, and to recharge groundwater before winter.

Before the rain, the U.S. Drought Monitor indicates most of northern New England was either in a moderate drought or abnormally dry.