U.S. equities closed out August with a weekly gain, breaking a streak of losses in a tumultuous month that was dominated by the trade war.

The S&P 500 Index rose 2.8 percent in the five days through Friday. The Dow Jones industrial average increased 3 percent to 26,403. The Nasdaq Composite Index advanced 2.7 percent.

While stocks rose this week, the S&P 500 ended the month 3.3 percent below its July 26 record high.

August was marked by some of the wildest price swings of 2019 as markets gyrated on every apparent bust-up and breakthrough in the U.S.-China trade showdown. This psat week’s rally came as Beijing indicated it won’t immediately retaliate against new tariffs, steadying investors’ nerves. End-of-month portfolio rebalancing may also have helped.

The S&P 500 posted its biggest weekly gain since early June. All 11 major industry groups advanced. Industrial stocks, which tend to be more affected by trade tensions, were the best performers, rallying 3.6 percent.

The U.S. Treasury will sell $45 billion of three-month bills and $42 billion of six-month bills on Tuesday. They yielded 1.98 percent and 1.87 percent, respectively, in when-issued trading. It will also sell four-week bills and eight-week bills on Thursday.

— Bloomberg News