(CNN) -- President Barack Obama made a previously unannounced visit Thursday to the Massachusetts Emergency Management Agency, which is dealing with widespread flooding in the region.
Obama made the stop after a speech on health care reform in Portland, Maine, and before two fundraising appearances in Boston.
At the emergency agency's facility, Obama met with Massachusetts Gov. Deval Patrick, a fellow Democrat and political ally, as well as local officials and workers combating flooding from recent storms. He spoke with workers coordinating the response to the flooding, saying at one point: "Sounds like at least with some sunshine and sandbags, we can hope for the best."
Later, he began his remarks at the fundraising events by thanking the government workers involved in the flood relief effort.
"It is worth reminding people at a time when folks who work in government don't get enough credit (that) when times are tough, when trouble arises, there are all kinds of civil servants out there who work 24/7," Obama said.
Patrick has declared a state of emergency and activated the National Guard.
The worst flooding has occurred in neighboring Rhode Island, where more than 10,000 people were without power and officials said long-term recovery could take months.
A rainstorm soaked Northeastern states Tuesday, worsening the effects of a major storm that struck two weeks ago.
Homeland Security Secretary Janet Napolitano will visit Rhode Island on Friday to inspect flood damage and meet with state and local leaders to discuss response and recovery efforts.
In Connecticut, Gov. Jodi Rell said a state of emergency put in place for the earlier storm remains in effect.
The Massachusetts Emergency Management Agency is the state agency responsible for coordinating federal, state, local, voluntary and private resources during emergencies and disasters in the state.