President Donald Trump announces his decision that the United States will withdraw from the Paris Climate Agreement in the Rose Garden of the White House on June 1, 2017. (Kevin Lamarque/Reuters)

The number two diplomat at the U.S. Embassy in Beijing resigned Monday, telling staff his conscience would not permit him to formally notify the Chinese that the United States is withdrawing from the Paris climate accord.

David H. Rank, a career foreign service officer of 27 years, had been acting ambassador until former Iowa Gov. Terry Branstad was confirmed as the new ambassador last month. He held a town meeting with embassy employees to explain he had offered his resignation and it had been accepted.

As the head of the embassy until Branstad arrives, it was Rank’s responsibility to deliver a formal notification of the U.S. intention to withdraw from the climate pact.

According to a State Department official, who spoke on condition of anonymity to be more candid, Rank was unwilling to deliver the démarche.

He told his staff that as “a parent, a patriot and a Christian,” he could not in good conscience play a role in implementing President Trump’s decision to withdraw, according to a colleague familiar with Rank’s comments.

Rank’s resignation was a display of the diplomatic unease over Trump’s decision to exit the Paris accord. Under the Obama administration, climate change was incorporated into the daily business of diplomacy at every level, and Rank was known for his personal concern about the environment. Career diplomats like Rank have been overseeing embassies around the world because of how slowly the Trump administration has been nominating political appointees as ambassadors.

“Mr. Rank made a personal decision,” said a spokesperson for the East Asian and Pacific Affairs Bureau. “We appreciate his years of dedicated service to the State Department.”

Rank did not immediately respond to a request for comment. His resignation was first reported by John Pomfret, editor-at-large at SupChina.

Adding to the awkwardness, over the weekend another career diplomat broke ranks with Trump after he criticized London Mayor Sadiq Khan for suggesting there was “no reason to be alarmed” by armed police patrols in the city. A few hours later, Lewis Lukens, the acting ambassador of the U.S. Embassy in Britain, used the U.S. Embassy twitter account to say Khan had shown “strong leadership” in responding to the London Bridge terrorist attack.

Foreign Service officers take pride in putting their personal politics aside and representing their country, under both Republican and Democratic presidents, making this type of resignation unusual.

The State Department moved swiftly to replace Rank, informing the Ministry of Foreign Affairs that Jonathan Fritz would be the new charges d’affaires, the deputy who heads the mission in the ambassador’s absence. Branstad is undergoing diplomat training, and has not arrived yet.

Rank, who speaks Mandarin Chinese, French, Dari and Greek, was a China hand who was on his fourth tour in China. Before that, he had been a political counselor at the U.S. Embassy in Kabul, director of the State Department’s Office of Afghanistan Affairs.

Dan Feldman, who was the Special Representative for Afghanistan and Pakistan when Rank was a senior adviser there, said Rank was the quintessential, nonpolitical diplomat.

“I couldn’t tell you what his politics were until now,” he said. “I don’t remember having a political conversation with him in which he espoused issues or concern about anything other than serving the president, and the secretary of state, and the interest of the American people.”

Though Rank told his staff he had expected to retire by the end of the year, being acting ambassador for a large and important embassy like the one in Beijing would have put him line to become ambassador in another, smaller country.

Simon Denyer in Beijing contributed to this report.