PORTLAND — Superstorm Sandy subsided Tuesday with Maine escaping the storm’s most damaging path, but as night fell, many residents remained in the dark.

As of 8:25 p.m., Central Maine Power Co. reported that about 31,000 customers were still without power.But by 9:40 p.m., that number had been reduced to 21,871.

More than 159,000 customers lost power at some point during the storm.

“It is our hope that everyone should have their power back by no later than Thursday, and possibly sooner,” CMP spokesman John Carroll said Tuesday evening.

Carroll said CMP expected to have power restored to most communities north of Augusta by Tuesday night, with the exception of some remote towns in northern Franklin County.

Carroll said Cumberland and York counties remained the hardest hit by outages. He attributed that to stronger winds off the ocean and more leaves on trees.

He said repair crews will in all likelihood head south to places such as New York and New Jersey to help with the restoration efforts once their work in Maine is completed.

While it might seem like it is taking a long time for some customers to get their power turned back on, Carroll said the restoration effort is on target.

“We’re recovering from what might be a once-in-a-century event. We think we had a good (restoration) plan in place,” he said.

As the weather cleared midday Tuesday, some activities returned to normal.

The Coast Guard reopened the ports of Portland and Portsmouth at 10 a.m. to all traffic after closing them before the height of the storm Monday.

The worst storm-related mishap in Maine occurred when a working barge in Bar Harbor sunk at its mooring during the storm, said Coast Guard Lt. Nick Barrow in South Portland. The Coast Guard is working with the harbormaster there to have the barge raised, he said.

Two members of the Coast Guard in South Portland also will be sent to New York City to help with storm recovery efforts there over the next four to five days, he said.

Flights from Portland International Jetport were canceled on Tuesday morning, though there were no problems specifically in Portland.

“The jetport itself, we’re in fine shape,” said Bob Rothbart, who works in the airport’s communications center. “The runways, everything is open, but like everything else on the East Coast, the airlines took their airplanes and sent them to safe places.”

Regularly scheduled flights were expected to resume at about 11:25 a.m., but major delays were expected well into the afternoon. Travelers were urged to contact their airline for flight-specific information.

Candy and Don Gagnon of Gardiner were on their way to Fort Myers, Fla., for a vacation and arrived 2½ hours early because they feared the jetport would be mobbed with people.

“We thought it might be crazy,” Don Gagnon said. “It looks like a ghost town.”

With no lines, and few airline staff in sight, there was little urgency. “Now we’re going to go read,” he said.

The Amtrak Downeaster canceled Tuesday’s runs between Boston and Portland because of power outages in New Hampshire, said Patricia Quinn, executive director of the Northern New England Passenger Rail Authority. Without power, crossing lights and barriers don’t work, so trains have to go slow and conductors have to manually flag them through the road crossings, she said.

“We didn’t want to have people get on and four hours from now we’ll get you to Boston,” Quinn said. “At this point in time we just don’t think we can be reliable at all,” she said.

Amtrak announced Tuesay night, however, the Downeaster would resume service on Wednesday.

York emergency dispatchers reported several roads closed because of trees downing wires, with extensive power outages.

BRANCH CRASHES INTO BEDROOM

For Michael Gordon of Wells, the damage – and his mortality – were apparent. Gordon was in the bedroom of his Canterbury Road home around 1 a.m. Tuesday when the branch of a toppled pine tree punctured the ceiling, narrowly missing him.

“I’m laying in bed and I could hear the cracking. I rolled out of bed just as the branch came through,” Gordon said. “The sheetrock was blowing all over me.” Water, too, poured through the opening in the ceiling, soaking the floor.

The Wells Fire Department called CMP crews to the house to remove the pine tree because it had fallen across power lines connected to the house.

The bedroom carpet was strewn with pieces of wood and tufts of fiberglass insulation. Gordon’s front yard was covered with pieces of the tree and the twisted remnants of his flagpole.

Nathaniel Higgins, at the York dispatch center, reported early Tuesday morning that several roads were still blocked there and areas of town that were without power were getting service back.

“We were on a generator all night but we just got power back here,” Higgins said.

‘PIRATE PARTY’ IN VACANT HOUSE

Also in Wells, police said they charged five people with criminal trespass for throwing a party in a vacant house late Monday night.

Officers checking on the vacant house at 503 Ocean Ave. found a group of adults from York and South Carolina having a “pirate party” to celebrate Hurricane Sandy, said. Lt. Jerry Congdon.

“I don’t know how they found this place,” Congdon said. “They were pretty well inebriated when we arrived.”

Congdon said the five partygoers were burning driftwood in the fireplace and were cooking fried chicken. As many as 15 people had been at the party earlier in the evening, he said.

All were charged with criminal trespass and are scheduled to appear Jan. 23 in York District Court. Their names were not immediately available because power at the police station was spotty Tuesday morning, Congdon said.

Emergency management officials in York County said that besides some road closures and power outages, there was little damage.

“Overall, we got out of it pretty lucky, all things considered,” said Steve Harding, spokesman for the York County Emergency Management Agency.

SHELTERS OPEN

In Cumberland County, Anne-Marie Brett, deputy director of the Cumberland County Emergency Management Agency, said that as day broke people would get a better idea of the extent of the storm damage, though it appeared minimal.

“We’ve had no major reports overnight of any extreme problems,” Brett said.

“There’s lots of notification of some wires down, some trees down, but very few complete road closures so that in a way is good for us,” Brett said. “We have seen the number of outages go down overnight and now they’re starting to come up which is to be expected.”

Emergency officials in southern Maine opened shelters for people without power.

In Cumberland County, the Bridgton Community Center on Depot Street is open.

The Bremen Fire Station has opened a warming shelter with hot showers which will stay available from 9 a.m. to 9 p.m. Tuesday.

Buxton’s Groveville Fire Station on Turkey Lane is open, but will be closing by 6 p.m. Tuesday.

Bill Gribbin, 72, of Littlejohn Island in Yarmouth, was using a chainsaw Tuesday afternoon to cut up branches he found littering his yard when he returned after spending the night inland.

“Whenever the wind gets blowing, we don’t feel at peace,” he said. “We bailed out of here and went to town where it is safe.”

At 1 p.m., a quarter of the town was still without power, according to a CMP supervisor in the area.

On Route 88 in Falmouth, which was closed at Depot Road, crews from Time Warner Cable and CMP worked to repair equipment after a huge tree fell over and took down lines.

“What a mess,” said Colin Chase, a lineman with Time Warner. “There’s stuff everywhere.”

“It’s not a good pole to get hit” because it carries so many different services, he said. “Hey, we’ll fix it as quick as we can.”

TOP GUST CLOCKED AT 76 MPH

The worst of superstorm Sandy brought 25-foot waves, winds over 60 mph overnight and a blackout that affected tens of thousands of people.

A gust of 76 mph was recorded Monday night at a home weather station in Bath, according to the National Weather Service in Gray. That exceeded the forecasted high wind speed of 60 mph.

The predicted rainfall of 1 to 3 inches in southern Maine never came. Only 0.56 inches had fallen in Portland as of 11 p.m.

“Basically, the rainfall was not the story. It was the wind,” said Mike Kistner, a meteorologist with the National Weather Service.

He said the wind was expected to start subsiding by Tuesday morning. The day’s forecast calls for light showers and windy conditions.

AT CAMP ELLIS, ‘UNBELIEVABLE’ WIND

At Camp Ellis Tuesday morning, Mike Otazo stood alone at the end of Lower Beach Road as the sun rose Tuesday morning over Camp Ellis.

After a windy night in his house near the ocean, he was curious to see what daylight would reveal.

“I wanted to wake up and see a hurricane sunrise,” he said.

Otazo never lost power in this seaside neighborhood in Saco, but he said the wind was “unbelievable.”

“It sounded like my windows were going to bust out,” he said.

There was some sand and seaweed left behind on Lower Beach Road by water that splashed over the sea wall, but nothing out of the ordinary after a big storm, Otazo said. A sign lay twisted at the end of the street.

On Main Avenue, Camp Ellis resident Linnea Olsen walked her two dogs, a cup of coffee in hand. She said she could hear the ocean from her home Monday night, which is unusual.

“It was roaring pretty hard,” she said. “I think we were very, very fortunate we were spared.”

Early Tuesday, roads to Camp Ellis were still barricaded to vehicle traffic but by mid-morning, the roads had re-opened. Piles of sand covered the intersection of Main and North avenues, but there was no visible flooding or damage.

On the beach at end of Fairhaven avenue in Saco, a giant protective sandbag ruptured, allowing water to flow up the street and some of the boulders providing protection from the surf washed away.

A few miles inland in Buxton, Timberline Country Store was open and running on a generator in an area of town that has been without power since Monday evening. A steady stream of people stopped in for coffee and breakfast sandwiches on their way to work before dawn.

‘A LOT OF SEAWEED’ AT OLD ORCHARD BEACH

People walking on Old Orchard Beach said they were surprised how little debris washed up on the sand. Near the Pier, Irwin Merrill of Westbrook used a metal detector and shovel to search piles of seaweed.

“It’s just a lot of seaweed so far,” he said.

Scott and Jennifer Provencher of Old Orchard Beach walked the beach with their children, 5-year-old Riley and Vivienne, 2. Riley hopped on top of a log to pose for photos as waves crashed under the Pier behind him.

Jennifer Provencher said she was surprised there wasn’t more debris, but was grateful power stayed on throughout the storm.

At Higgins Beach in Scarborough, sightseers and dog-walkers enjoyed the high surf just after sunrise. The storm tossed seaweed and driftwood up on Bayview Avenue and a seawall was partly eroded at one end of Higgins Beach, but there was little damage otherwise.

PORTLAND AREA ESCAPES SERIOUS DAMAGE

The city of Portland fared the storm without major problems, Nicole Clegg, the city’s spokeswoman, said on Tuesday.

She said there was flooding in the Bayside neighborhood along Marginal Way at high tide around midnight, but it was not severe. The storm also knocked down a couple of utility poles on Washington Avenue Ext. and Riverside Drive, she said.

State police and Cumberland County emergency dispatchers reported no storm-related injuries overnight.

Erin Pelletier, a dispatcher with the Cumberland County Regional Communications Center, said: “None of the main roads are closed. It’s just the side streets that didn’t take priority.”

Crews worked through the night to reopen major commuter routes like River Road in Windham, which had been closed for downed trees and wires, she said.

“We actually lucked out I think,” she said.

Worries about the storm led Scarborough to postpone Halloween trick-or-treating until Saturday, and even though the worst of the fears didn’t materialize, the town is sticking with the decision.

“Scarborough still has scattered outages, wires down and debris hazards,” said a statement from the Police Department. Besides, it noted, there’s more rain to come this week.