President Donald Trump accused China and the European Union of manipulating their currencies lower to make their goods and services less expensive to foreign buyers and again knocked the Federal Reserve for increasing interest rates in the U.S., saying all undercut the nation's "competitive edge." The dollar swiftly weakened against other global currencies after the president's tweets.

"As usual, not a level playing field," Mr. Trump wrote.

China, the European Union and others have been manipulating their currencies and interest rates lower, while the U.S. is raising rates while the dollars gets stronger and stronger with each passing day - taking away our big competitive edge. As usual, not a level playing field... — Donald J. Trump (@realDonaldTrump) July 20, 2018

The euro, yen and yuan gained against the U.S. dollar right after the president took to social media on Friday morning, while the dollar index, which measures the U.S. currency against global currencies, was lately off 0.6 percent.

"We think the devaluation is on purpose," Carl Weinberg, chief international economist at High Frequency Economics, wrote in a client note regarding China's latest currency change. "Whatever its cause, a cheaper yuan will keep China's unit labor costs in foreign currency from rising in foreign currency terms."

Get Breaking News Delivered to Your Inbox

Mr. Trump also took aim at rate increases by the U.S. central bank, departing from decades of presidents refraining from commenting on the strength of the U.S. dollar or the actions of the Federal Reserve to combat inflation and stimulate economic growth.

"Tightening now hurts all that we have done. Debt coming due & we are raising rates - Really?" he tweeted.

The Fed has hiked interest rates five times since Mr. Trump took office, with the last two increases coming under Chairman Jerome Powell, whom the president picked to replace Janet Yellen.

The president's remarks on China and the EU run counter to a semi-annual report from the Treasury Department in April that abstained from identifying any nation as a currency manipulator. The Treasury, usually the lead spokesperson for the dollar, for years has stuck to the script that a strong dollar is good for the economy.

The dollar has recently been in rally mode, but Mr. Trump's comments may have put at least a temporarily end to its rise.