About 25,000 customers lost power this afternoon after the Hawaiian Electric Co.’s largest energy provider suddenly went offline, a HECO spokeswoman said.

At about 1:40 p.m., AES Hawaii notified HECO that it stopped sending power to the electrical utility, and HECO’s grid automatically cut off power to 25,000 customers to protect the system, said HECO spokeswoman Shannon Tangonan.

The customers affected were in Kailua, Kaneohe, Salt Lake, lower Pearl City, and Waipahu.

HECO restored power to all customers in about 10 minutes by switching to backup power generators.

At about 3:45 p.m., AES Hawaii was still offline, but HECO’s system was stabilized, Tangonan said.

AES provides about 20 percent of HECO’s load. AES did not immediately return a call for comment.