Gas prices hit $4 a gallon again as the U.S. and Iran launched more attacks.

The national average for a gallon of gas reached $4.003 on Monday, marking the first time in over a month it has crossed that threshold, according to AAA data. The price represents a national average, meaning drivers in some states are paying more than $4 a gallon, while others are paying less.

The national average for diesel, which influences the cost of groceries and other goods transported on trucks, reached $5.11 a gallon on Monday.

Gas prices escalated after the war in Iran began on Feb. 28, hitting a recent high of $4.56 in May. Prices began to moderate as negotiations between the U.S. and Iran progressed, with the two sides reaching an interim deal in June.

However, oil and gas prices are creeping higher as fighting between the U.S. and Iran intensifies, with the two sides vying for control of the Strait of Hormuz. Secretary of State Marco Rubio told reporters Sunday that the "only reason" why the U.S. is launching strikes is because of the Islamic Republic's attacks on ships in the waterway, which serves as a vital chokepoint for oil shipments.

"As the U.S. military degrades the terrorist Iranian regime's ability to attack commercial vessels and disrupt the free flow of energy through the Strait of Hormuz, oil and gas prices will plummet back to pre-conflict levels," White House spokeswoman Taylor Rogers said in a statement to CBS News.

Oil prices, which influence the price at the pump, have been rising since early July, CBS News' energy tracker shows. Brent crude, the international standard, rose 1% to $88.98 per barrel Monday and benchmark U.S. crude climbed 0.8% to $82.44 per barrel, according to Oilprice.com.

The rise in gas prices is likely to weigh on voters as U.S. midterm elections approach. In a Gallup poll released last month, two-thirds of Americans surveyed said the cost of fuel has caused financial hardship for their household.

Edited by
Aimee Picchi

The Associated Press
contributed to this report.