North Dakota’s oil production hit a five-month high and climbed back over 1 million barrels per day in October, after falling below that yardstick for two consecutive months.

The state pumped out 1.043 million barrels per day in October — up 7 percent over September — as oil prices rose, according to data released Tuesday by the North Dakota Department of Mineral Resources. The state hit its all-time high production mark of 1.23 million barrels per day in December 2014.

Lynn Helms, director of the mineral resources department, called October’s production increase a “surprise.”

In August, North Dakota’s oil output dipped below 1 million barrels per day for the first time since March 2014, and repeated that performance in September. It was a trend expected to continue.

Still, Helms said in a web conference with reporters Tuesday that he “wouldn’t expect a repeat of October in these winter weather months.” With the cold descending on North Dakota, fracking for oil becomes more expensive and more complicated.

North Dakota, the nation’s second largest oil producing state, has been hammered by falling prices over the past two years — along with the entire U.S. petroleum industry. There are some signs for optimism, though.

“Oil prices are up, activity is up, production is up,” Helms said.

Oil prices Monday hit a one-year high. West Texas Intermediate (WTI) — a benchmark crude — traded down a bit Tuesday, but still closed at nearly $53 a barrel. For much of last winter, WTI traded below $35 a barrel.

Prices have firmed in the past few weeks as major oil producing nations have committed to cutting production. But it’s far from clear that a sustained recovery in the oil market is underway; members of OPEC and non-OPEC members often stray from quotas.

Oil prices need to stay in the $50 to $60 per-barrel range to spark more activity in North Dakota.

The drilling rig count in North Dakota — an indicator of future production — was still historically low at 40 in November, but it has climbed by six since September. That mirrors rising rig counts elsewhere in the U.S.

“The industry indicated there will be 50 rigs [in North Dakota] by the middle of next year,” Helms said. “That’s a real positive trend.”

The state’s peak drilling rig count was 218 in May 2012, as scores of new wells were created during the state’s oil boom. While drilling for new wells is relatively low now, the number of producing oil wells in October in North Dakota hit a preliminary all-time high of 13,457, according to state data.