TOKYO — Japan extended its yearlong streak of modest economic growth in the last three months of 2016, data showed on Monday.

Output in the country, which has the world’s third-largest economy but has struggled to shake off deflation, expanded in each quarter last year, the longest uninterrupted period of growth in three years. However, the pace of expansion has been slowing, and questions about how Japan will weather a trade-skeptical Trump administration persist.

What happened?

Japan’s gross domestic product increased by 1 percent in annualized terms in the three months through December, the government’s Cabinet Office said in a preliminary estimate. That was a hair slower than forecast; economists had expected an expansion of 1.1 percent. Japan, whose growth is held back by a shrinking population, had not increased its output for four straight quarters since 2012-13. The rise in the fourth quarter was weaker than in the rest of 2016, however.

What has been lifting output?

Exports, mostly. It has become a familiar pattern: Global demand for Japanese cars, chemicals and other products keeps factories humming, even as domestic spending sputters. In the last three months of the year, exports surged 11 percent in annualized terms, according to Cabinet Office data. Domestic consumer spending, the biggest component of G.D.P., was essentially flat. Investment by businesses was up 3.8 percent, although much of that, too, is linked to exports as companies gear up factories to sell things abroad.

Could Trump threaten exports?

President Trump has pulled the United States out of the Trans-Pacific Partnership, a trade deal Japan backed. He has repeatedly complained about America’s large trade deficit with Japan, which he says is exacerbated by unfair Japanese trade policies. Retaliation, if it came, could choke off an important source of growth. That is a big reason Prime Minister Shinzo Abe has been cultivating friendly ties with Mr. Trump.