(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."





Family needs boat to get to front door





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.





See first-hand stories from the flood zone





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.
Who did the president thank? How many fundraisers did the president attend? Who met with Massachusetts Gov? Who did the president thank at the fundraiser? When will Napolitano visit Rhode Island? Where did Obama meet the officials? Who will visit Rhode Island on Friday? Who did Obama meet with?
government workers involved in the flood relief effort. two Barack Obama government workers involved in the flood relief effort. Friday Management Agency, Janet Napolitano Massachusetts Gov. Deval Patrick,
question: Who did the president thank?, answer: government workers involved in the flood relief effort. | question: How many fundraisers did the president attend?, answer: two | question: Who met with Massachusetts Gov?, answer: Barack Obama | question: Who did the president thank at the fundraiser?, answer: government workers involved in the flood relief effort. | question: When will Napolitano visit Rhode Island?, answer: Friday | question: Where did Obama meet the officials?, answer: Management Agency, | question: Who will visit Rhode Island on Friday?, answer: Janet Napolitano | question: Who did Obama meet with?, answer: Massachusetts Gov. Deval Patrick,