Thousands of Central Maine Power customers in southern and central Maine lost electricity Tuesday, according to CMP.

CMP spokeswoman Catharine Hartnett said the outages were caused by windy conditions after recent heavy rains.

“We’ve had so much rain that tree roots can get loose, and then when the wind comes the trees just go right over,” she said.

Nearly 1,400 customers remained without power near 9 p.m., most of them in York, Oxford and Lincoln counties.

About 2,800 customers in the town of Yarmouth were without power for nearly two hours Tuesday afternoon, although power was restored there by 3 p.m., according to the company’s website. Other affected communities include Bowdoinham, Cumberland, Freeport, North Yarmouth, Scarborough and Windham.

The National Weather Service reported sustained winds of 21 mph and gusts exceeding 30 mph in Portland on Tuesday afternoon.

Rainfall has totaled 19.6 inches so far this year, slightly above the average of 17.8 inches for the period, according to the weather service. Melting snow also has contributed to saturated ground.