U.S. factory production bounced back in May after a four-month slump while the growth of industrial output in China fell to its slowest pace since 2002.

Manufacturing output rose 0.2 percent after a 0.5 percent decline in April, according to data from the Federal Reserve released Friday. Manufacturing makes up around 75 percent of total industrial production and accounts for about 12 percent of the U.S. economy.

Overall industrial production, which adds mining and utilities to factories, increased 0.4 percent in May, better than expected. April’s contraction was revised to an improved 0.4 percent decrease.

Data from China Friday showed that growth in industrial output had slowed to the weakest pace since 2002, indicating that U.S. tariffs are taking a toll on the world’s second-largest economy.

The U.S. factory data is an important sign that the U.S. manufacturing sector is more resilient to trade stress than many economists had forecast. Bolstering the case for a stronger U.S. economy was a separate report Friday on U.S. retail sales that showed better than expected gains in May and revised April and March higher.

Consumer durable goods production rose by 2 percent and overall consumer goods production rose 0.5 percent, reflecting the ongoing strength of the U.S. consumers. Automotive production grew 3.4 percent, partially reversing a series of declines earlier this year. Machinery production rose 1.1 percent. Business equipment production was up 0.2 percent. High tech production, including semiconductors and communication equipment, rose.

Capacity utilization rose by more than expected to 78.1 percent from 77.9 percent.