Drenching rains lashed Maine on Wednesday, downing trees, knocking out power and leaving vehicles stranded on flooded roads across the state.

The National Weather Service in Gray said 5.63 inches of rain fell in Portland, putting the super-soaker down as one of the top 10 rainiest days in the city’s history. Precipitation records in Portland date to 1871.

Meteorologist Margaret Curtis said the storm placed sixth on the top 10 list, which has Oct. 21, 1996, at No. 1, when 11.74 inches were recorded at the Portland International Jetport. The 6.43 inches that fell at the jetport on Aug. 14, 2014, checked in at No. 5.

Wednesday’s torrential downpour peaked between 11 a.m. and noon in Portland, with 2.22 inches of rain falling in that hour alone, Curtis said.

In Bath, a Central Maine Power Co. substation flooded, knocking out power at Bath Iron Works and homes and businesses in central and southern Bath at around 2:45 p.m. The outage prompted BIW to release first-shift workers early and cancel the second shift.

A flash flood warning and a coastal flood warning were in effect through late Wednesday afternoon as the powerful storm moved through the state.

“We just were running crazy there for two hours during the heavy downpour,” said Portland Assistant Fire Chief David Jackson. The department received 33 calls in two hours, with reports of stranded motorists, flooded basements and water leaking through roofs and setting off fire alarms, he said.

Portland’s previous rainfall record for Sept. 30 was 2.14 inches in 1920, Curtis said.

Other areas of the state got even more, with 9.75 inches reported in Searsport, 7.49 inches in West Rockport, 6.6 inches in Lewiston and 6.27 inches in Standish.

Curtis said the weather service doesn’t keep records for outlying communities such as Searsport. She said the 9.75 inches was reported by a weather watcher and is unofficial unless it can be confirmed by other sources.

“Having that much rain fall is not out of the realm of possibility, but in my mind it would have a red asterisk next to it for now,” Curtis said.

More rain could be on the way this weekend. Tropical Storm Joaquin strengthened to a Category 3 hurricane Wednesday night as it neared the Bahamas. Forecasters are divided about whether the eye of the storm will hit the East Coast.

Wednesday’s rains shut down the Androscoggin Bridge between Durham and Lisbon, and roads in Camden, Livermore Falls, Winslow and Skowhegan, some of which had 1 to 2 feet of water in low-lying intersections. Scarborough and Old Orchard Beach also shut down roads that were flooded.

In Brunswick, the Public Works Department had to close River Road near its intersection with Rocky Hill Road after the force of the rushing water “blew out” a culvert.

Portland’s flooding was aggravated by an 11.6-foot high tide, which peaked at 1:14 p.m., leaving no room for the city’s storm drains to discharge the sudden volume of water. Instead, columns of water dislodged manhole covers and inundated busy intersections. Once the tide went out, floodwaters receded and stranded motorists were able to get their cars towed.

“We had about five times the call volume we typically would have,” said Pat Moody, spokesman for AAA of Northern New England. “It was really concentrated in the Greater Portland area. A lot of people calling for vehicles flooded that needed to be towed, stuck in a ditch or drove somewhere they shouldn’t have.”

Moody said that once water gets above a vehicle’s floorboards and into the engine compartment, the vehicle should get checked out by a technician before being started.

“You could damage components, electrical systems, anything water is not supposed to get in,” Moody said.

A car immersed in fresh water can often dry out and be fine, but being flooded with saltwater, which can happen in low areas of East Bayside, can cause irreversible damage, he said.

Jillana Springer of Scarborough had just left an appointment at 10:30 a.m. on Marston Street in Portland when she saw workers replacing a manhole cover, but the road was not closed off.

“I had no idea it was as bad as it was,” she said. As she drove into the intersection of Marston and Congress streets, her Honda Accord bogged down in deeper water. “When the car first started to stall, I knew it wasn’t going anywhere,” she said.

Springer called police, who told her to get out of the car. She said it was a spooky experience: “It was up to my hips. The water was moving.” A nurse for 30 years, she said, “I don’t get worked up easily, but that got my blood pressure up.”

Elsewhere, CMP reported 7,800 customers without power at 5:30 p.m. Wednesday. By 10 p.m., the outages had been reduced to just over 3,600. The worst outages were in the central and eastern parts of the state.

The University of Southern Maine canceled classes at the Portland, Gorham and Lewiston-Auburn campuses at 12:30 p.m., and speed limits on the Maine Turnpike were lowered to 45 mph during the height of the storm.

The rainy forecast led directors of the Cumberland County Fair to close the midway and call off harness racing Wednesday.

Trinity Day School, located in four classrooms in the basement of Trinity Episcopal Church on Coyle Street in Portland, canceled its program for the rest of the day at about 10:45 a.m.

“The floodwater is coming into every classroom,” said Kyler Mooers, a teacher at the private school that serves infants through pre-K.

Outside Portland, parts of the Maine Mall parking lot in South Portland were covered with at least a foot of water, and flooding at the Rockland Public Library threatened the local historical society collection there. Hunter Road in Freeport was closed for more than an hour when power lines came down.

The intersection of St. John Street and Park Avenue in Portland was closed because of waist-deep water at 1:30 p.m. Several cars were stranded in front of the HP Hood facility on Park Avenue, where water was almost as high as the bottom of tractor-trailer trucks. Cars parked at La Quinta Inn, across from Hood, had water up to their wheel wells.

Derek Tarbox got caught in the traffic jam that was created when Congress Street outbound was shut down at St. John Street. He and his wife decided to ditch the taxi and walk the few blocks to their hotel, but were confronted by waist-deep standing water.

“I was debating taking my boots off and rolling my pants up,” he said, staring at the expanse of water covering the street. He decided to walk back toward St. John Street.

Tarbox, a fisherman, had just come in from a trip on an 80-foot boat off the Maine coast. “It’s been nice for a few weeks,” Tarbox said, “but when the captain saw the weather, he said, ‘We’re going in.’ It would have been crazy” at sea.

By 2 p.m., the water in that area appeared to be subsiding.

The forecast calls for Thursday to be mild with cloudy skies in the southern part of the state and high temperatures in the low 60s. Conditions should be fine until Hurricane Joaquin threatens to move in to end the weekend.

“Right now it looks like it’s going to be dry probably through Sunday,” said Tom Hawley, a meteorologist with the weather service. “The question mark is what happens with the hurricane. Models are all over the place on that one.”

Chris Chase at the Coastal Journal contributed to this report.