A 4.0 magnitude earthquake struck about 30 miles outside of Portland, Maine, on Tuesday night, officials said, shaking the ground throughout New England and surprising thousands of residents who rarely experience the phenomenon.

“It was a 10-second event,” Steve McCausland, a spokesman for the Maine Department of Public Safety, said in a phone interview. “And other than residents calling public safety dispatchers to report [feeling a tremor], that was the main aftereffect.”

He said there were no immediate reports of property damage or injuries.

Get Fast Forward in your inbox:

Forget yesterday's news. Get what you need today in this early-morning email.

Her 20-year-old son, Devin, said he went outside after the shaking to try to determine what happened, and he saw similarly befuddled neighbors.

People in Greater Boston were buzzing Tuesday night in the immediate aftermath.

Paul DiNatale of Newburyport said by phone that his house shook for 20 seconds, and at first he thought there was a problem with his boiler.

“It was a scary experience,” he said.

Sandee Storey, a Jamaica Plain resident who lives on the top floor of a triple-decker, said in an e-mail that her free-standing stove “sort of jumped up and down and rattled loudly.”

“My cat . . . ran away,” she wrote. “It felt like a giant was stamping its feet in a sudden tantrum the way the floor shook.”

Experiencing significant earthquakes in New England is rare, but not unprecedented.

A 5.8-magnitude earthquake centered in Virginia in August 2011 shook the Boston area. In June 2010, a 5.0-magnitude quake on the Ontario/Quebec border was felt in the Greater Boston area, and smaller quakes sometimes occur.

Michael Hagerty, manager of the New England Seismic Network at the Weston Observatory, said the 2011 quake was well over 10 times as strong as Tuesday’s earthquake.

“In terms of [property] damage, we don’t really expect to start seeing significant damage until the magnitude hits about 5” on the Richter scale, he said.

Hagerty said the scale is a logarithmic scale, meaning the amplitude of the shaking increases by a factor of 10 as the reading jumps from 4 to 5, and the energy released increases by a factor of 30.

One of the most significant temblors to hit the Boston area occurred in 1755, when a 6.2-magnitude quake struck off Cape Ann.

Tremors from Tuesday’s quake did not appear to cause any significant problems in the Bay State. Representatives of the Massachusetts Port Authority, which runs Logan International Airport, and the Massachusetts Bay Transportation Authority said travel was not affected on their systems.

Peter Judge, a spokesman for the Massachusetts Emergency Management Agency, said there were no immediate reports of property damage or injuries.

And Governor Deval Patrick, in a statement Tuesday night, echoed those remarks.

“So far, we have no reports of injury or damage in Massachusetts. MEMA will continue to monitor the situation closely,” the governor said.

Around Boston, some students described their reactions when the quake hit.

The shaky ground was felt by Marta Williams, 19, and Armando Vacquez, 20, both Emerson students who were on campus.

Williams said she was in her dorm room when the shaking began.

“I thought there was a person walking on my ceiling, but then I realized that’s impossible because I’m on the 12th floor,” she said. “I went on ­Facebook and everyone was talking about it. That’s how I found out. . . . I freaked out a little.”

Vacquez was in a campus library, and said the response from students was muted.

“Everyone looked up, looked at each other, then looked back down,” he said. “It was nothing like in the movies, no books falling or anything.”

Travis Andersen can be reached at tandersen@globe.com. ­Follow him on Twitter @TAGlobe. Derek Anderson, who reported from Maine, can be reached at derek.anderson@globe.com and Melanie Dostis can be reached atmelanie.dostis@globe.com.

BostonGlobe.com complimentary digital access has been provided to you, without a subscription, for free starting today and ending in 14 days. After the free trial period, your free BostonGlobe.com digital access will stop immediately unless you sign up for BostonGlobe.com digital subscription. Current print and digital subscribers are not eligible for the free trial.

Thanks & Welcome to Globe.com

You now have unlimited access for the next two weeks.

BostonGlobe.com complimentary digital access has been provided to you, without a subscription, for free starting today and ending in 14 days. After the free trial period, your free BostonGlobe.com digital access will stop immediately unless you sign up for BostonGlobe.com digital subscription. Current print and digital subscribers are not eligible for the free trial.