BOSTON — The icy weather that affected most of the country last week also wreaked havoc on oil refineries, which has caused the average gas price in Massachusetts to soar.

The state’s average gas price has jumped 9 cents from last week, to $2.56, according to AAA Northeast. That is 20 cents higher than a month ago.

The state average is 7 cents lower than the national average, but the national average is up 13 cents from last week and is 24 cents higher than a month ago.

“When close to 40 percent of U.S. crude production is offline because refineries are closed, there is going to be pain at the pump until operations resume,” said AAA Northeast spokeswoman Mary Maguire.

“The good news is, the nearly two dozen impacted refiners are expected to restart operations this week, if they haven’t already.”