FRANKFURT, June 21 (Reuters) - The euro held its ground as the world's second most used currency for trade, finance and reserve-building even as Russia slashed its reliance on it after being hit by sanctions, a European Central Bank report showed on Wednesday.

The dominance of the U.S. dollar and the euro -- a distant second -- as global currencies is being called into question by the rise of China, the deterioration of relations between Russia and the West, and by talk of greater financial independence in emerging countries from India to Brazil.

But the ECB's annual report on the international role of the euro highlighted its resilience, even though the central bank cautioned that this could change quickly.

The euro kept or even increased its share of the world's foreign exchange reserves, international debt and loans, as well as foreign exchange turnover, the report said.

Its share of global payments via the SWIFT messaging system dropped from roughly 40% to 30% but this was largely to the benefit of the dollar, with only marginal gains in alternative currencies such as China's renminbi.

Russia slashed its use of the euro as an invoicing currency and turned to the rouble and the renminbi after being sanctioned by the European Union and other Western powers over its invasion of Ukraine in February 2022.

But the rouble's usage on the SWIFT system collapsed after its banks were disconnected from that network, the world's largest. The report did not provide data on alternative messaging systems such as Russia's and China's.

The ECB's report said an internationally used currency can quickly be replaced by another when trade flows shift.

It cited evidence from Europe itself, where the euro has replaced the dollar as an invoicing currency in countries neighbouring the euro area since the common currency's launch in 1999.

"International currency status should not be taken for granted," ECB President Christine Lagarde said in a statement accompanying the report.

Board member Fabio Panetta added "further European economic and financial integration", such as a complete capital markets union, would be "pivotal in increasing the resilience of the international role of the euro in a potentially more fragmented world economy".

The report also showed London remained the main venue for foreign exchange trading in euros and that Britain’s importance for international financial activities in euros had not changed materially since Brexit. (Reporting by Francesco Canepa Editing by Gareth Jones)