WASHINGTON, May 12 (Reuters) - U.S. Deputy Secretary of State Wendy Sherman, the country's number two diplomat, said on Friday she will retire at the end of June after three decades in Washington's foreign policy establishment.

Sherman is the first woman to serve in her current role, in which she has headed up the Biden administration's diplomacy with China and led unsuccessful talks with Russia to avert Moscow's February 2022 full-scale invasion of Ukraine.

Secretary of State Antony Blinken credited Sherman with breaking barriers for women and working on "some of the toughest foreign policy challenges of our time."

"Our nation is safer and more secure, and our partnerships more robust, due to her leadership," Blinken said in a statement.

In a note to State Department staff announcing her retirement, Sherman said her latest stint in government starting in 2021 was marked by shifting geopolitical tides, citing the U.S. withdrawal from Afghanistan, rising competition with China and the war in Ukraine.

"(N)othing lent itself to straightforward answers," Sherman wrote in the note seen by Reuters.

In January 2022, as Russian forces massed near Ukraine's borders, Sherman was dispatched to meet Russian Deputy Foreign Minister Sergei Ryabkov in Geneva, but the talks broke down, with Moscow's envoy pressing demands on European security that Washington had already dismissed as not viable.

“We knew that we were going to be off to the races,” Sherman said of the talks in a New York Times interview ahead of her retirement announcement.