Maine and New Hampshire were stuck Sunday in the midst of a crazy weather cycle, with Portland nearly breaking a century-old rainfall record, significant snow falling in the mountains of New Hampshire and summerlike heat heading our way in just four days.

After the heavy rain tapers off Monday, a low-pressure system in the Gulf of Maine should begin to stabilize the weather pattern, with Portland and the rest of the state poised for a stretch of comfortable temperatures and sunshine.

“It’s going to be like night and day,” Stacie Hanes, a meteorologist with the National Weather Service in Gray, said Sunday evening. “We’ll have a pretty good run after this.”

Sunday’s weather, however, was all over the place.

Hanes said the Portland International Jetport reported that 0.62 inches of rain fell Sunday, an amount that nearly broke the 124-year-old record of 0.70 inches set on May 14, 1893.

The rainstorm started Saturday night and continued into Sunday night. While it was pouring in Portland, it was snowing like crazy in the mountains of New Hampshire.

Hanes said 14 inches of snow fell on Mount Washington on Saturday and Sunday. “We were surprised. They always overdo things up there,” she joked.

Two staff members who work at the Mount Washington Observatory celebrated the Mother’s Day snowstorm on Facebook by posting a photograph of a heart-shaped mound of snow, with “Mom” written in the snow.

Observatory staff said the Mount Washington summit averages 12 inches of snow in May, but the most snow on record for the month was 96 inches in 1997.

Nelson, New Hampshire, received 9 inches of snow over the weekend, while Upton, an Oxford County town on the Maine border with New Hampshire, reported 2 inches.

Hanes said the weather should start to improve after Monday. Temperatures in Portland on Tuesday and Wednesday will hit 70 degrees.

But on Thursday, the state will experience a dramatic shift from the cool, wet weather we have been getting lately. Hanes said the high temperature in Portland could reach 85 degrees that day, and it won’t be particularly humid.

The drought conditions that first appeared in Maine in June 2016 ended in late April. There are no regions in Maine that are currently experiencing drought, according to the National Drought Mitigation Center.

Hanes said the weekend rainstorm helped conditions improve even further. By mid-October 2016, almost 70 percent of Maine was experiencing some drought conditions. Maine hadn’t experienced a drought in 14 years.