A surprisingly strong report on the economy helped power the benchmark S&P 500 and Nasdaq Composite indexes to record high closes on Friday, capping a week of gains for stocks that came largely on the back of resilient corporate profits.

While Intel was the largest drag on the day after it gave a bleak outlook, Amazon’s results provided the largest boost. Disney also offered support as it turned in strong box office numbers.

After staying close to flat for much of the day the S&P, Nasdaq and the Dow Jones Industrial Average gained ground in the last hour of trading to register their second record closes for the week. The S&P’s peak for the day was a point below its intraday record.

For the week, the S&P rose 1.2 percent, while the Dow lost 0.06 percent, and the Nasdaq gained 1.86 percent.

After a late 2018 sell-off, stocks have rallied this year in large part due to a more dovish stance from the Federal Reserve as well as hopes for a U.S.-China trade resolution.

The Commerce Department’s data indicated gross domestic product rising faster than expected due to high inventories while consumer and business spending slowed sharply, and homebuilding investment contracted for a fifth straight quarter.

The U.S. Federal Reserve meeting is due to start on Tuesday.

The S&P’s biggest boost on Friday was from the consumer discretionary sector, which rose 0.9 percent. Its biggest support was from Amazon, which rose 2.5 percent after the company’s quarterly earnings number doubled, exceeding consensus estimates, though its second quarter guidance was lower than expectations.

Ford chalked up a gain of 10.7 percent and was the largest percentage gainer on the S&P after the automaker posted better-than-expected quarterly earnings, largely due to strong pickup truck sales in its core U.S. market.

The S&P’s technology index was the largest drag on the benchmark, with a 0.4 percent decline.

Intel fell 8.99 percent after it cut its full-year revenue forecast and missed the sales estimate for its key data center business in its quarterly report late Thursday.

Out of the S&P 500’s 11 major sectors, energy was the largest percentage loser with a 1.2 percent drop as oil prices sank more than 3 percent after U.S. President Donald Trump again pressured the Organization of the Petroleum Exporting Countries to raise crude production to ease gasoline prices.

Exxon fell 2 percent after its quarterly earnings number missed estimates.

Disney rose 1.95 percent after Marvel Studios superhero spectacle “Avengers: Endgame” brought in a record $60 million at U.S. and Canadian box offices during its Thursday night debut.

Approximately 6.45 billion shares changed hands on the major domestic equity exchanges, as compared to the 6.64 billion share average over the past 20 trading days.

GDP Up 3.2 Percent in First Quarter

Economic growth accelerated in the first quarter, but the burst in growth was driven by trade and the largest accumulation of unsold goods since 2015, temporary factors that are likely to reverse in the coming quarters.

Gross domestic product increased at a 3.2 percent annualized rate in the first quarter, the Commerce Department said in its advance GDP report released on Friday. An increase in government investment, which offset sharp slowdowns in consumer and business spending was a major component.

Nonetheless, the mixed report could further dispel earlier fears resulting from weak economic data at the turn of the year. Those fears were also exacerbated by a brief inversion of the Treasury yield curve.

The economy grew at a 2.2 percent pace in the October-December period. Growth has stepped down from a peak 4.2 percent pace in the second quarter of 2018, when the White House’s $1.5 trillion tax cut package stimulated consumer spending. The economy will mark 10 years of expansion in July, the longest on record.

Federal Reserve officials are likely to shrug off the surge in growth last quarter and focus on a measure of domestic demand, which increased at only a 1.3 percent rate, the slowest since the second quarter of 2013, after increasing at a 2.6 percent pace in the October-December quarter.

The Fed recently suspended its three-year monetary policy tightening campaign, dropping forecasts for any interest rate hikes this year. The U.S. central bank increased borrowing costs four times in 2018.

Exports rose and imports declined in the first quarter, leading to a small deficit that added 1.03 percentage points to GDP after being neutral in the fourth quarter. 

Trade tensions between the United States and China have caused wild swings in the trade deficit, with exporters and importers trying to stay ahead of the tariff fight between the two countries.

The standoff has also had an impact on inventories, which increased at a $128.4 billion rate in the first quarter, the strongest pace since the second quarter of 2015. Inventories increased at a $96.8 billion pace in the October-December quarter. 

Part of the inventory build was because of weak demand, especially in the automotive sector, which is expected to weigh on future production at factories.

Inventories contributed 0.65 percentage point to first-quarter GDP after adding one-tenth of a percentage point in the October-December period.

Growth in consumer spending, which accounts for more than two-thirds of our economic activity, slowed to a 1.2 percent rate from the fourth quarter’s 2.5 percent rate. The moderation in spending reflected a decline in motor vehicle purchases and other goods, likely related to a 35-day shutdown of the federal government. There was also a slowdown in spending on services.

Business spending on equipment braked sharply, rising at only at a 0.2 percent rate, the slowest since the third quarter of 2016. Spending was held down by weak outlays on agricultural machinery and office furniture.

Residential construction fell at a 2.8 percent rate, marking the fifth straight quarterly decline. Government investment rebounded at a 2.4 percent rate, driven by spending at state and local governments.

Consumer Confidence Better Than Previously Thought

Bloomberg reported on Friday that consumer sentiment fell less than initially reported in April and was slightly above estimates on upbeat personal-finance expectations and buying conditions.

The University of Michigan’s final April sentiment index hit 97.2, down from 98.4 in March, exceeding the preliminary reading of 96.9 as well as the forecast in Bloomberg’s survey. 

The gauge of current conditions was weaker than previously reported while the expectations index was slightly stronger, the report Friday showed.

The decline in confidence reflected dimmer expectations for the economy for the next 12 months, with sentiment down from March’s strong reading.

At the same time, sentiment may pick up in the near future, with the stock market reaching record highs and recent data indicating the economy, consumer spending and the job market aren’t slowing as sharply as feared.

Other recent sentiment readings have been mixed. Bloomberg’s monthly economic expectations gauge rose in April, while the Conference Board confidence measure is forecast to rebound following a March drop.

The data followed a government report Friday showing economic growth accelerated to a 3.2 percent annualized rate in the first quarter on a major boost from inventories and trade. That was offset by consumer spending, the largest part of the economy, which rose a slightly-above- forecast 1.2 percent.

“Income gains remained widespread and reports of increases in net household wealth rose among middle- and upper-income households,” Richard Curtin, director of the University of Michigan consumer survey, said in a statement.

Consumers continued to anticipate muted price gains. Inflation expectations for the year ahead edged up from the preliminary reading to 2.5 percent while the rate seen over the next five to 10 years held at 2.3 percent, matching a half-century low.

The measure of personal-finance expectations was the highest since 2004 and unchanged from the preliminary reading.

Interviews were conducted March 27 to April 22, while the preliminary survey closed April 10.