BERLIN (Reuters) - Former Chancellor Gerhard Schroeder has lost another legal bid to reverse a decision to strip him of his government-funded office taken after the Kremlin's invasion of Ukraine amid public outcry over his ties to Russia.

The Bundestag said in 2022 that Schroeder, Social Democrat Chancellor from 1998 to 2005, was no longer carrying out duties in his capacity as former chancellor so did not deserve the publicly-funded office and staff to which he had been entitled.

The decision came amid public anger at Schroeder over his refusal to distance himself from Russian President Vladimir Putin, whom the former chancellor has described as a personal friend.

He lost a case with a Berlin court to reverse the decision last year. On Thursday, a spokesperson for the Upper Administrative Court in Berlin said he lost that bid too.

Schroeder visited the Russian leader in Moscow in 2022 and said afterwards that Russia wanted a negotiated solution to the war in Ukraine. Ukrainian President Volodymyr Zelenskiy branded Schroeder's behaviour as "disgusting".

Long criticised for his close links to the Russian energy sector, including the Nord Stream gas pipeline, Schroeder stood down from the board of Russia's state-owned oil company Rosneft and declined a nomination for a board position at Gazprom.

Last year, the SPD decided Schroeder could remain a party member as he had not violated any party rules. A local chapter of the SPD had sought to expel him.

(Reporting by Alex Ratz and Sarah Marsh; Editing by Madeline Chambers)