By Jonathan Stempel

NEW YORK (Reuters) -- The Bill & Melinda Gates Foundation Trust has sued Brazil's Petrobras to recoup stock losses stemming from a corruption scandal at the state-run oil company.

According to a complaint filed late Thursday night in federal court in Manhattan, Petrobras' "pervasive bribery and money laundering scheme" caused the trust and another plaintiff, WGI Emerging Markets Fund LLC, to lose tens of millions of dollars by investing in the company.

"Indeed, the scandal still seems to escalate by the day - as more guilty pleas, more arrests, and more secret bank accounts are uncovered," the complaint said.

Petrobras, whose formal name is Petroleo Brasileiro SA, is facing a slew of U.S. class-action litigation claiming that years of corruption, including bribery, inflated the value of more than $98 billion of its stock and bonds.

Created in 2000 by Microsoft Corp co-founder Bill Gates and his wife Melinda, the Gates Foundation focuses on improving health and education and reducing poverty.

Based in Seattle, it is among the world's largest philanthropic organizations, with a $41.3 billion endowment.

Berkshire Hathaway Inc Chairman Warren Buffett is a trustee of the foundation.

The trust, which manages the endowment assets, is suing on its own, suggesting it believes it might recover more of its losses on Petrobras' American depositary shares that way.

A Brazilian affiliate of Petrobras auditor PricewaterhouseCoopers (PwC) is also a defendant.

Petrobras and PwC declined to comment. Lawyers for the trust did not respond to requests for comment.

Westwood Global Investments LLC, a Boston-based firm, manages investments for the foundation and the WGI fund.

Petrobras' market value has plunged more than 90 percent from nearly $300 billion seven years ago.

It took a $17 billion writedown in April for overvalued assets. Prosecutors have said more than $2 billion of bribes were paid over a decade, mainly to Petrobras executives from construction and engineering companies.

The case is WGI Emerging Markets Fund LLC et al v. Petroleo Brasileiro SA et al, U.S. District Court, Southern District of New York, No. 15-07568.

(Additional reporting by Guillermo Parra-Bernal in Sao Paolo; Editing by Jeffrey Benkoe and Bill Rigby)