BUSBARI, Italy  - Financial leaders of seven leading world economies pledged stronger cooperation against cyber crime on Saturday and not to use foreign exchange to gain competitive advantage, but stuck to their cautious wording on trade, their final communique showed.

Finance ministers and central bank governors from the United States, Canada, Japan, France, Germany, Italy and Britain met in the Italian city of Bari to discuss the world economy, combating terrorist funding, cyber security and taxes.

The final communique of the meeting said the seven countries would use all policy tools - fiscal, structural and monetary - to boost economic growth.

It also said the G7 financial leaders would strengthen cooperation to counter cyber threats such as a global online attack which infected tens of thousands of computers in nearly 100 countries on Friday.

The statement said fiscal policy should be used to help job creation while keeping public debt on a sustainable path and monetary policy should help economic activity without fuelling strong inflation.

"We reaffirm our existing G7 exchange rate commitments to market-determined exchange rates and to consult closely in regard to actions in foreign exchange markets," it said.

"We reaffirm our fiscal and monetary policies have been and will remain oriented towards meeting our respective domestic policy objectives, using domestic instruments and we will not target exchange rates for competitive purposes," it said, underlining the importance of refraining from competitive devaluations.

But unlike a G7 leaders' communique of 2016, the Bari meeting did not endorse free trade and reject protectionism, reflecting pressure from the United States where President Donald Trump has signaled his scepticism about free trade deals.

The G7 financial leaders repeated a line agreed by the broader Group of 20 in March which said: "We are working to strengthen the contribution of trade to our economies."

As a global cyber attack infected tens of thousands of computers in nearly 100 countries on Friday, the G7 financial leaders said:

"We recognize that cyber incidents represent a growing threat for our economies and that appropriate economy-wide policy responses are needed."

They called for common shared practices to spot quickly any vulnerabilities in the world's financial system and stressed the importance of effective measures to assess cyber security among individual financial firms and at sector level.

Italian finance minister Pier Carlo Padoan told reporters that the discussions, which had been scheduled before Friday's attacks, were "unfortunately very timely."