U.S. equity indexes and Treasury bonds posted gains Friday, snapping a four-day losing streak, as crude oil prices retreated despite sticky inflation data.

The S&P 500 rose 1 percent, the Nasdaq Composite climbed 1 percent, and the Dow Jones Industrial Average advanced 1.2 percent. Futures had signaled gains ahead of the open: Dow futures added 0.5 percent, S&P 500 futures rose 0.5 percent, and Nasdaq-100 contracts edged up 0.6 percent.

August consumer prices increased 0.4 percent monthly and 3.4 percent annually, matching economist expectations but remaining well above the Federal Reserve's 2 percent target. The annual rate held steady from July, though the monthly increase outpaced July's 0.1 percent gain.

Energy costs drove much of the inflation concern. Brent crude briefly topped $108 per barrel before Friday's decline. U.S. diesel prices hit an all-time high of $6.05 per gallon, up from $5.32 a month earlier and $3.70 a year ago, according to AAA data.

The sustained oil-price surge and rising Treasury yields in the preceding week had pushed Fed rate-hike expectations to 72 percent from roughly 50-50 a week prior. Two-year Treasury yields edged higher Friday after climbing 20 basis points across the curve during the week. Longer-term yields posted minor declines.

Oracle shares surged over 5 percent in premarket trading and opened more than 2 percent higher on strong cloud computing growth in its latest quarterly earnings.