Secretary of State Rex Tillerson appealed to State Department employees on Thursday to maintain their integrity and to be kind in a “mean-spirited town” as he bid farewell to the staff he led for barely a year.

Tillerson urged a few hundred employees gathered in the main lobby of the Harry S. Truman Building to show respect for each other and to undertake one act of kindness a day. He drew sustained applause when he added: “This can be a very mean-spirited town. But you don’t have to choose to participate in that. Each of us get to choose the person we want to be, and the way we want to be treated, and the way we will treat others.”

Tillerson, 66, was fired by President Trump on March 13. He officially learned of his dismissal through a Trump tweet saying that CIA Director Mike Pompeo would be his replacement.

Tillerson had rebuffed suggestions he would resign amid a series of White House leaks over the previous months, apparently calculated to shame him into leaving, and lately had insisted he would be at the State Department through the end of the year, if not longer.

In his speech, Tillerson did not mention Trump by name but invoked the values of respect, integrity, honesty and accountability, all core attributes he cited at meet-and-greet gatherings with embassy employees around the world.

“Never lose sight of your most valuable asset, the most valuable asset you possess: your personal integrity,” Tillerson said. “Only you can relinquish it or allow it to be compromised. Once you’ve done so, it is very, very hard to regain it.”

“I hope you will continue to treat each other with respect,” he continued. “Regardless of the job title, the station in life or your role, everyone is important to the State Department. We’re all just human beings trying to do our part.”

Tillerson officially remains secretary of state until March 31, but he has turned over the day-to-day running of the agency to his deputy, John Sullivan. In a speech, Sullivan said Tillerson was returning to his ranch in Texas later in the day.

“His work for our country, leading the department, his voice for peace, for humanitarian assistance has been an inspiration for me,” Sullivan said. “And I was honored — have been honored to work for him, to have been selected by him to serve as deputy secretary of state.”

All secretaries of state make their ritual arrival and farewell speeches in the lobby of the building where Tillerson spoke the day he first entered it on Feb.­ 2, 2017, and again on Thursday.

Many speak from the stairway to a mezzanine so they can be viewed by all in the jam-packed room. But Tillerson addressed the crowd from the lobby floor, standing in front of a wall plaque dedicated to State Department employees who have been killed in the line of duty. It was a poignant nod to Tillerson’s concern for the safety of his staff. He often spoke of waking up in the morning wondering whether everyone was safe.

The crowd of assembled of employees Thursday was noticeably sparser than usual. A large number of senior officials have resigned or taken early retirement, in part because they did not want to serve the Trump administration but also because they considered Tillerson remote and instrumental in their being sidelined in U.S. foreign policy.

Among those in the crowd was Steve Goldstein, the undersecretary who was fired when he contradicted the White House version of Tillerson’s dismissal. Goldstein told reporters that his boss had not spoken to the president that morning and had no idea why he was being replaced.

Although some had mixed views of Tillerson’s brief tenure — and some were highly critical — many thought he had been treated shabbily by the White House.

Aaron David Miller, a Middle East expert who served under six secretaries of state, tweeted that Tillerson, who had the shortest tenure of any top diplomat in modern U.S. history, “never had a chance and was treated in a cruel/humiliating manner.”

But criticism still followed Tillerson as he walked out the door.

John Kirby, a former State Department spokesman who now works as an analyst on CNN, tweeted, “Tillerson deserves credit for being a gentleman & a man of integrity. But we should not forget the degree to which he failed to: advance a cohesive foreign policy . . . promote & respect the expertise of career diplomats . . . and fight for the resources the State Dept sorely needs.”

Tillerson’s 14 months at the helm of State Department were marked by several disagreements with the president he served. Tillerson urged Trump not to withdraw the United States from international commitments made by the previous administration, such as the Paris climate accord and the Iran nuclear deal, which Trump is contemplating leaving.

Trump in turn repeatedly undercut Tillerson, often contradicting his top diplomat’s measured statements with a breezy tweet. Their relationship never seemed to recover after Tillerson reportedly was overheard referring to Trump as a “moron,” a remark Tillerson never denied, calling it beneath his dignity. Trump later offered to compare IQ test results.

In leaving an administration where federal employees are sometimes denigrated as being part of a “deep state” intent on derailing Trump’s agenda, Tillerson expressed appreciation for the contributions made by State Department employees. He thanked employees “from the mailroom to the seventh floor and all points in between.” The seventh floor is where Tillerson and his senior aides have offices.

“The country faces many challenges,” he said, “in some instances perplexing foreign affairs relationships, and in other instances serious national security threats. In these times, your continued diligence and devotion to the State Department’s mission has never been more necessary.”

John Hudson contributed to this report.