WASHINGTON- The U.S. current account deficit decreased in the second quarter as goods exports rose, the Commerce Department said on Wednesday in a report that also showed U.S. firms paid about $169 billion in dividends from repatriated earnings.

The Commerce Department said the current account deficit, which measures the flow of goods, services and investments into and out of the country, narrowed by $20.3 billion to $101.5 billion, or 2.0 percent of national economic output, in the April-June period.

The current account deficit amounted to the smallest share of national output since the third quarter of 2014.

Analysts polled by Reuters had expected the current account deficit to narrow to $103.5 billion.

The Commerce Department said a tax overhaul passed by Congress in December 2017, which changed how repatriated earnings are taxed, led many companies to bring back cash parked abroad.

Companies paid out dividends and other withdrawals of $169.5 billion from foreign receipts during the second quarter, the department said, which far outstripped the amount of this cash which was reinvested. (Reporting by Jason Lange; Editing by Andrea Ricci) ((jason.lange@thomsonreuters.com; +1 202 310 5487; Twitter @langejason; Reuters Messaging: jason.lange.thomsonreuters.com@reuters.net))