North Dakota's oil production rose 3.5 percent in August, hitting the highest monthly mark since early 2016.

North Dakota, the nation's second largest oil producer, pumped out 1.085 million barrels of crude per day in August, compared with 1.048 million per day during the previous month, according to data released Tuesday by North Dakota's Department of Mineral Resources.

The state's output generally has been rising in 2017, after dropping below 1 million barrels per day for a few months in 2016 and in January of this year.

The oil rig count in North Dakota currently stands at 57, up from 56 in September and August, but down from a peak of 58 in July. A rising rig count indicates operators are drilling more new wells.

The rig count, which stood at 38 in January, increased steadily during the first half of 2017.

Oil companies grew more optimistic after prices moved over $50 barrel for three months beginning in early December. Prices have fluctuated since spring, and West Texas Intermediate (WTI) — the benchmark U.S. crude price — fell to just over $42 per barrel in June. WTI closed Tuesday at nearly $51 per barrel.

Oil prices ranging from $50 to $60 per barrel are generally needed to spark increased activity in North Dakota's oil fields.

OPEC, a group of oil-producing nations, extended production cuts for nine months in August. But some of its members haven't been complying with output targets, helping to depress global prices.

Plus, rising U.S. shale oil production this year has blunted the effects of OPEC's cuts.

"Oil price weakness is now anticipated to last through calendar year 2017," according to a monthly report released Tuesday by Lynn Helms, director of North Dakota's Department of Mineral Resources.