WASHINGTON—The U.S. and five other countries including China will tap their national strategic petroleum reserves in an attempt to bring down gasoline prices that have become a sore spot with motorists and a big contributor to inflation, the White House said.

Crude prices for future delivery ticked upward after the announcement early Tuesday, partly reversing a recent fall in these commodity markets. Oil traders for weeks had anticipated action from the White House as President Biden’s advisers grappled with how to address rising prices for gasoline, groceries and other consumer products that have put its legislative agenda at risk.