The S&P 500 and the Nasdaq closed higher on Thursday as ithe Street looked to the G20 summit in Osaka, Japan this weekend for progress in the long-running U.S.-China trade dispute, which has whipsawed markets for months.

The benchmark S&P 500 snapped its four-day losing streak, closing within 1% of its all-time high, reached a week ago. The Dow closed slightly lower, dragged down by Boeing.

Optimism fueled by a China Morning Post report that the world’s two largest economies have agreed to a tentative trade war truce was dampened by a Wall Street Journal article saying that Chinese President Xi Jinping will present President Donald Trump with a set of conditions to be met by the United States before reaching any settlement.

Expectations of a deal were muddied further when White House economic adviser Larry Kudlow said the United States may move ahead with further tariffs on Chinese goods after the two leaders meet this weekend at the Group of 20 summit in Japan. Trump and Xi are expected to discuss a way forward regarding tariffs and other issues when they meet.

Of the 11 major sectors in the S&P 500, all but energy stocks ended the session higher.

Chip manufacturers, whose revenue exposure to China makes them vulnerable to tariffs, ended the session higher. The Philadelphia Semiconductor index rose 1.5%.

Ford advanced 2.9% after the automaker announced it would cut 12,000 jobs in its troubled Ford Europe segment.

Boeing fell 2.9% following a Reuters report on Wednesday that the U.S. Federal Aviation Administration identified a new safety risk in the company’s grounded 737 MAX aircraft.

Conagra Brands reported quarterly earnings that missed analyst estimates because of waning demand and manufacturing challenges. Its shares fell 12.1%.

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

Momentum Fading

Economic growth accelerated in the first quarter but the export and inventory augmentation to activity masked weakness in domestic demand, some of which appears to have prevailed in the current quarter.

The nation’s gross domestic product increased at a 3.1% annualized rate, driven in part by spending on highways and defense, the government said in its third reading of first-quarter GDP. That was unchanged from its estimate last month. The economy grew at a 2.2% pace in the October-December period.

Despite the unchanged reading, growth in consumer spending was revised lower and business investment in intellectual property products was stronger than previously estimated.

There were also upward revisions to spending on nonresidential structures. Revisions to the trade deficit and inventory accumulation were minor.

Excluding trade, inventories and government spending, the economy grew at only a 1.3% rate in the first quarter. That was the slowest rise in this measure of domestic demand since the second quarter of 2013.

When measured from the income side, the economy grew at a tepid 1.0% rate in the last quarter. Gross domestic income (GDI) was previously reported to have increased at a rate of 1.4% in the first quarter. The average of GDP and GDI, also referred to as gross domestic output and considered a better measure of economic activity, increased at a 2.1% rate in the January-March period, down from the 2.2% growth pace estimated last month.

Federal Reserve Chairman Jerome Powell last week acknowledged the temporary boost to economic growth from trade and inventories, which he described as “components that are not generally reliable indicators of ongoing momentum.”

A gauge of inflation tracked by the Fed increased at a 1.2 percent rate in the first quarter, instead of the previously reported 1.0 percent pace.

The economy will mark 10 years of expansion in July, the longest on record. But momentum is slowing, with manufacturing struggling, the trade deficit widening again, and the housing sector still mired in a soft patch.

While consumer spending appears to have regained speed in the second quarter, business spending on equipment is expected to have contracted further following Wednesday’s weak report on durable goods orders in May. The trade war between Washington and Beijing is hurting both business and consumer confidence.

The Atlanta Fed is forecasting GDP growth to rise at a 1.9% annualized rate in the April-June quarter.

Trade and inventories accounted for the bulk of the surge in GDP growth in the last quarter. The trade deficit narrowed to $905.0 billion in the first quarter, instead of $903.6 billion as reported last month. The trade gap contributed 0.94 percentage point to GDP rather than the 0.96 percentage point estimated last month.

U.S.-China trade tensions have caused wild swings in the trade deficit, with exporters and importers trying to stay ahead of the tariff fight between the two economic giants. The standoff has also had an impact on inventories. Growth in inventories was revised down to a $122.8 billion rate in the first quarter from the previously estimated $125.5 billion pace.

Part of the inventory build was because of weak demand. Inventories contributed 0.55 percentage point to first-quarter GDP, rather than the 0.60 percentage point reported last month.

Growth in consumer spending, which accounts for more than two-thirds of U.S. economic activity, was revised down to a 0.9% rate, the weakest in a year. Consumer spending was previously reported to have increased at a 1.3% pace in the first quarter.

Business spending on equipment declined at an unrevised rate of 1.0% rate, the weakest since the first quarter of 2016. Government investment increased at a 2.8% rate. It was previously reported to have risen at a 2.5% rate.

The government also reported on Thursday that after-tax profits without inventory valuation and capital consumption adjustment, which correspond to S&P 500 profits, fell at a 0.2% rate in the first quarter. Profits were previously reported to have dropped at a 0.8% pace.

Jobless Claims Increase to Highest Level in Seven Weeks 

New unemployment benefits increased by more than expected to a seven-week high, a possible sign of strains in the labor market that could factor into the Fed’s debate over whether to cut interest rates next month.

The Labor Department reported on Thursday morning that new jobless claims rose by 10,000 claims to a total of 227,000 claims for the week ended June 22 That number exceeded all estimates in Bloomberg’s survey of economists. The four-week average, a less-volatile measure, increased to 221,250, the highest in more than a month.

The uptick in claims may heighten concerns about the strength of the labor market after job gains trailed estimates in May. Even so, the June employment report due next week will likely prove more important as it will provide a detailed picture ahead of Fed officials’ meeting in late July.

The data may reflect some volatility related to the end of the school year, as Connecticut, Massachusetts and New Jersey all recorded large increases in unadjusted claims. In addition, figures for California were estimated, showing an unadjusted rise of 5,155.

Even with the increase nationally, jobless claims remain near historically low levels as higher wages and low unemployment support consumer spending, which accounts for most of the economy.

Continuing claims, which are reported with a one-week lag, rose by 22,000 to 1.69 million in the week ended June 15. The unemployment rate among people eligible for benefits held at 1.2%. Economists surveyed by Bloomberg had forecast that claims would rise to 220,000.

Consumer Comfort Advanced Last Week to 18-Year High

Consumer sentiment rose last week to its highest level in 18 years as a rally in the stock market contributed to increased optimism about the economy, personal finances and the buying climate.

The Bloomberg Consumer Comfort Index advanced 1.8 points in the week ended June 23 to 63.6, the highest since December 2000, data showed on Thursday. A gauge of views about the economy was the strongest since early 2001, while a measure of household finances improved to an almost 19-year high.

Stock indexes at record highs and hourly earnings that have climbed at least 3% year-over-year for 10 consecutive months are probably contributing to increased optimism.

Gains in comfort measures of household finances and the buying climate may also signal steady consumer spending after a government report two weeks ago showed a broad-based gain in May retail sales.

There was also relief after Trump removed threats to increase tariffs on goods from Mexico in exchange for Mexican efforts to help curb illegal immigration into the U.S. may also have played a role in consumer views about the economy.

The comfort gauge contrasts with a decline in the Conference Board’s monthly measure of consumer confidence, which fell to the lowest since 2017, as well as the University of Michigan’s sentiment gauge, which eased in early June.

Sentiment among Democrats and single Americans was at its highest since 2001. Other 18-year highs were recorded in the comfort indexes for women, consumers in the West and those with a college education. The index for those earning less than $50,000 advanced to highest in records back to 2010.