After joining Chinese leader Xi Jinping for dinner last year, San Francisco Mayor London Breed accompanied him to the airport to bid him farewell. There, on the tarmac, she made her request: pandas.

Her city’s zoo was faltering. Tourism was suffering and she faced a tough re-election campaign. A pair of pandas from China would be a political and public relations win.

What ensued were months of informal negotiations, with Breed — a politician with no foreign affairs or security experience — becoming a diplomat of sorts. She went to China, where she met the vice president and a deputy foreign minister, her calendars and emails show. She traveled with the editor of Sing Tao U.S., a pro-China newspaper that registers as a foreign agent in the United States, according to other records and photographs from the trip.